Skip to content

Commit

Permalink
Merge pull request #29 from atticus-lv/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
atticus-lv authored Dec 6, 2024
2 parents e9c9d6d + 18a8199 commit bdd1960
Show file tree
Hide file tree
Showing 144 changed files with 4,723 additions and 255 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

on:
push:
branches: [ "master","develop" ]
tags:
- 'v*.*.*'

- "v*.*.*"

jobs:
windows:
Expand All @@ -17,15 +17,15 @@ jobs:
run: mkdir upload

- name: Publish win-x64
run: dotnet publish src/VirtualStreetSnap -c Release -r win-x64 --self-contained -p:PublishAot=true
run: dotnet publish ./src/VirtualStreetSnap -c Release -r win-x64 --self-contained -p:PublishAot=true

- name: Zip win-x64
run: |
$files = Get-ChildItem -Path ./src/VirtualStreetSnap/bin/Release/net8.0/win-x64/publish/* -Recurse -Exclude *.pdb
Compress-Archive -Path $files.FullName -DestinationPath ./upload/VirtualStreetSnap.win-x64.aot.zip
Compress-Archive -Path $files.FullName -DestinationPath ./upload/VirtualStreetSnap.win-x64.zip
- name: Upload a Build Artifact
uses: actions/[email protected]
with:
name: VirtualStreetSnap
path: ./upload/VirtualStreetSnap.win-x64.aot.zip
path: ./upload/VirtualStreetSnap.win-x64.zip
65 changes: 39 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## VirtualStreetSnap

English/[中文](README.zh.md)

VirtualStreetSnap is a screenshot tool for save virtual street view basic on avaloniaui.

Compare to other screenshot tool, VirtualStreetSnap provide a more camera-like experience.
Expand All @@ -8,51 +10,61 @@ Compare to other screenshot tool, VirtualStreetSnap provide a more camera-like e

![ImageGallery](docs/images/gallery.png)

![ImageEditor](docs/images/ImageEditor.png)
![ImageGallery](docs/images/setting.png)

![ImageEditor](docs/images/editor.png)

![ImageEditor](docs/images/picker.png)

### Features

> v0.0.8
> v0.1.5
+ Radio button: select different size of screenshot.
+ 4:3 16:9 3:2 9:16 3:4 1:1
+ SnapShot view
+ Radio button: select different size of screenshot.
+ 4:3 16:9 3:2 9:16 3:4 1:1
+ Enter size (corner display)
+ Overlays
+ red focus border for indicate the screenshot area.
+ guidelines for help align the screenshot area.
+ grid
+ center
+ ratio

+ on top: always on top.

+ Overlays
+ red focus border for indicate the screenshot area.
+ guidelines for help align the screenshot area.
+ grid
+ center
+ ratio

+ Settings
+ on top: always on top.
+ translation\[en/zh\]: change the language
+ file prefix: custom file prefix for saving screenshot.
+ save directory: custom save directory for saving screenshots.
+ translation\[en/zh\]: change the language

+ Image gallery: review the screenshot.
+ Image viewer: view the screenshot.
+ flip the image.
+ scroll to zoom the image.
+ middle/left click to drag the image.
+ copy the image to clipboard.
+ pick the color from the image, and copy the color to clipboard.
+ Thumbnail viewer: view the thumbnail.
+ right click thumbnail to delete/open in explorer.
+ scroll to view more thumbnails.
+ async load thumbnail.
+ grab to fill the window.

+ right click menu
+ delete/open in explorer.
+ copy the image to clipboard.
+ scroll to view more thumbnails.
+ Send Image to Editor.
+ grab to ajust the window.

+ Image Editor
+ simple adjust layer system
+ add / move / delete layer; save and load with the gallery.
+ layer type
+ hsl
+ brightness/contrast
+ temperature
+ tint
+ sharpen
+ simple adjust layer system
+ add / delete layer; save and load with the gallery.
+ drag and drop to adjust the layer order.
+ layer (Realtime preview)
+ hsl
+ brightness/contrast
+ white balance(temperature/tint)
+ sharpen/blur
+ vignette
+ pixelate
+ curve

### Download

Expand All @@ -66,6 +78,7 @@ Environment
+ win10 x64

Build (aot by default)

```
dotnet publish
```
84 changes: 84 additions & 0 deletions README.zh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
## VirtualStreetSnap

[English](README.md)/中文

VirtualStreetSnap 是一个基于 avaloniaui 上保存虚拟街景基础的屏幕截图工具。

与其他屏幕截图工具相比,VirtualStreetSnap 提供了更像相机的体验。

![VirtualStreetSnap](docs/images/shot.png)

![ImageGallery](docs/images/gallery.png)

![ImageGallery](docs/images/setting.png)

![ImageEditor](docs/images/editor.png)

![ImageEditor](docs/images/picker.png)

### 功能

> v0.1.5
+ SnapShot 视图
+ 按钮:选择不同比例的屏幕截图。
+ 4:3 16:9 3:2 9:16 3:4 1:1
+ 输入大小(左下角显示)
+ 叠加层
+ 红色高亮边框表示屏幕截图区域。
+ 帮助对齐屏幕截图区域的指南。
+ 网格
+ 中心
+ 比例

+ 在顶部:始终在顶部。


+ 设置
+ 翻译\[English\中文\]:更改语言
+ 文件前缀:用于保存屏幕截图的自定义文件前缀。
+ 保存目录:用于保存屏幕截图的自定义保存目录。

+ 图片库:查看屏幕截图。
+ 图像查看器:查看屏幕截图。
+ 翻转图像。
+ 滚动以缩放图像。
+ 单击鼠标中键/左键可拖动图像。
+ 从图像中选择颜色,然后将颜色复制到剪贴板。
+ 缩略图查看器:查看缩略图。
+ 右键菜单
+ 在资源管理器中删除/打开。
+ 将图像复制到剪贴板。
+ 滚动以查看更多缩略图。
+ 将图像发送到编辑器。
+ 可调整尺寸。

+ 图像编辑器
+ 简单的调整图层系统
+ 添加 / 删除图层;保存到图片库。
+ 拖放以调整图层顺序。
+ 图层(实时预览)
+ HSL
+ 亮度/对比度
+ 白平衡(色温/色调)
+ 锐化/模糊
+ 晕影
+ 像素化
+ 曲线

### 下载

[Releases](https://github.com/atticus-lv/VirtualStreetSnap/releases)

### 开发

环境

+ .net 8.0 (C# 12.0)
+ win10 x64

构建 (默认启用aot编译)

```
dotnet publish
```
Binary file removed docs/images/ImageEditor.png
Binary file not shown.
Binary file added docs/images/editor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/gallery.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/picker.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/setting.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/shot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions src/LiveChartCurveControl/App.axaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<Application xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="LiveChartCurveControl.App"
xmlns:local="using:LiveChartCurveControl"
RequestedThemeVariant="Default">
<!-- "Default" ThemeVariant follows system theme variant. "Dark" or "Light" are other available options. -->

<Application.DataTemplates>
<local:ViewLocator/>
</Application.DataTemplates>

<Application.Styles>
<FluentTheme />
</Application.Styles>
</Application>
33 changes: 33 additions & 0 deletions src/LiveChartCurveControl/App.axaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
using Avalonia;
using Avalonia.Controls.ApplicationLifetimes;
using Avalonia.Data.Core;
using Avalonia.Data.Core.Plugins;
using Avalonia.Markup.Xaml;
using LiveChartCurveControl.ViewModels;
using LiveChartCurveControl.Views;

namespace LiveChartCurveControl;

public partial class App : Application
{
public override void Initialize()
{
AvaloniaXamlLoader.Load(this);
}

public override void OnFrameworkInitializationCompleted()
{
if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
{
// Line below is needed to remove Avalonia data validation.
// Without this line you will get duplicate validations from both Avalonia and CT
BindingPlugins.DataValidators.RemoveAt(0);
desktop.MainWindow = new MainWindow
{
DataContext = new MainWindowViewModel(),
};
}

base.OnFrameworkInitializationCompleted();
}
}
Binary file not shown.
27 changes: 27 additions & 0 deletions src/LiveChartCurveControl/LiveChartCurveControl.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
<ApplicationManifest>app.manifest</ApplicationManifest>
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
</PropertyGroup>

<ItemGroup>
<Folder Include="Models\"/>
<AvaloniaResource Include="Assets\**"/>
</ItemGroup>

<ItemGroup>
<PackageReference Include="Avalonia" Version="11.2.2"/>
<PackageReference Include="Avalonia.Desktop" Version="11.2.2"/>
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.2.2"/>
<PackageReference Include="Avalonia.Fonts.Inter" Version="11.2.2"/>
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.2.2"/>
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.1"/>
<PackageReference Include="LiveChartsCore.SkiaSharpView.Avalonia" Version="2.0.0-rc4.5" />
<PackageReference Include="MathNet.Numerics" Version="5.0.0" />
</ItemGroup>
</Project>
21 changes: 21 additions & 0 deletions src/LiveChartCurveControl/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using Avalonia;
using System;

namespace LiveChartCurveControl;

sealed class Program
{
// Initialization code. Don't use any Avalonia, third-party APIs or any
// SynchronizationContext-reliant code before AppMain is called: things aren't initialized
// yet and stuff might break.
[STAThread]
public static void Main(string[] args) => BuildAvaloniaApp()
.StartWithClassicDesktopLifetime(args);

// Avalonia configuration, don't remove; also used by visual designer.
public static AppBuilder BuildAvaloniaApp()
=> AppBuilder.Configure<App>()
.UsePlatformDetect()
.WithInterFont()
.LogToTrace();
}
32 changes: 32 additions & 0 deletions src/LiveChartCurveControl/ViewLocator.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
using System;
using Avalonia.Controls;
using Avalonia.Controls.Templates;
using LiveChartCurveControl.ViewModels;

namespace LiveChartCurveControl;

public class ViewLocator : IDataTemplate
{
public Control? Build(object? data)
{
if (data is null)
return null;

var name = data.GetType().FullName!.Replace("ViewModel", "View", StringComparison.Ordinal);
var type = Type.GetType(name);

if (type != null)
{
var control = (Control)Activator.CreateInstance(type)!;
control.DataContext = data;
return control;
}

return new TextBlock { Text = "Not Found: " + name };
}

public bool Match(object? data)
{
return data is ViewModelBase;
}
}
Loading

0 comments on commit bdd1960

Please sign in to comment.