├── .github
└── workflows
│ └── build.yaml
├── .gitignore
├── Directory.Build.props
├── Images
├── Japanese.256.png
├── README.md
├── SkiaImageView.100.png
├── SkiaImageView.2048.png
├── u1F58C-lowerleftpaintbrush.svg
└── u1F5BC-framewithpicture.svg
├── LICENSE
├── README.ja.md
├── README.md
├── SkiaImageView.Avalonia
├── BackingStore.cs
├── Interops.cs
├── Properties
│ └── AssemblyInfo.cs
├── SKImageView.cs
└── SkiaImageView.Avalonia.csproj
├── SkiaImageView.Avalonia11
├── Properties
│ └── AssemblyInfo.cs
└── SkiaImageView.Avalonia11.csproj
├── SkiaImageView.Maui
├── BackingStore.cs
├── Interops.cs
├── Properties
│ └── AssemblyInfo.cs
├── SKImageView.cs
├── SkiaImageView.Maui.csproj
└── StretchDirection.cs
├── SkiaImageView.Wpf
├── BackingStore.cs
├── Interops.cs
├── Properties
│ └── AssemblyInfo.cs
├── SKImageView.cs
└── SkiaImageView.Wpf.csproj
├── SkiaImageView.Xamarin.Forms
├── BackingStore.cs
├── Interops.cs
├── Properties
│ └── AssemblyInfo.cs
├── SKImageView.cs
├── SkiaImageView.Xamarin.Forms.csproj
└── StretchDirection.cs
├── SkiaImageView.sln
├── SkiaImageView
├── Internals.cs
└── SKImageView_Common.cs
├── artifacts
└── .gitkeep
├── build-nupkg.bat
├── nuget.config
└── samples
├── Directory.Build.props
├── SkiaImageView.Avalonia.Sample
├── SkiaImageView.Avalonia.Sample.UI
│ ├── App.axaml
│ ├── App.axaml.cs
│ ├── SkiaImageView.Avalonia.Sample.UI.csproj
│ ├── ViewModels
│ │ ├── ItemViewModel.cs
│ │ └── MainWindowViewModel.cs
│ └── Views
│ │ ├── Converters
│ │ └── ScoreToBrushConverter.cs
│ │ ├── MainWindow.axaml
│ │ └── MainWindow.axaml.cs
└── SkiaImageView.Avalonia.Sample
│ ├── Program.cs
│ └── SkiaImageView.Avalonia.Sample.csproj
├── SkiaImageView.Avalonia11.Sample
├── SkiaImageView.Avalonia11.Sample.Android
│ ├── Icon.png
│ ├── MainActivity.cs
│ ├── Properties
│ │ └── AndroidManifest.xml
│ ├── Resources
│ │ ├── AboutResources.txt
│ │ ├── drawable-night-v31
│ │ │ └── avalonia_anim.xml
│ │ ├── drawable-v31
│ │ │ └── avalonia_anim.xml
│ │ ├── drawable
│ │ │ └── splash_screen.xml
│ │ ├── values-night
│ │ │ └── colors.xml
│ │ ├── values-v31
│ │ │ └── styles.xml
│ │ └── values
│ │ │ ├── colors.xml
│ │ │ └── styles.xml
│ └── SkiaImageView.Avalonia11.Sample.Android.csproj
├── SkiaImageView.Avalonia11.Sample.Desktop
│ ├── Program.cs
│ └── SkiaImageView.Avalonia11.Sample.Desktop.csproj
├── SkiaImageView.Avalonia11.Sample.UI
│ ├── App.axaml
│ ├── App.axaml.cs
│ ├── SkiaImageView.Avalonia11.Sample.UI.csproj
│ ├── ViewModels
│ │ ├── ItemViewModel.cs
│ │ └── MainViewModel.cs
│ └── Views
│ │ ├── Converters
│ │ └── ScoreToBrushConverter.cs
│ │ ├── MainView.axaml
│ │ ├── MainView.axaml.cs
│ │ ├── MainWindow.axaml
│ │ └── MainWindow.axaml.cs
└── SkiaImageView.Avalonia11.Sample.iOS
│ ├── AppDelegate.cs
│ ├── Entitlements.plist
│ ├── Info.plist
│ ├── Main.cs
│ ├── Resources
│ └── LaunchScreen.xib
│ └── SkiaImageView.Avalonia11.Sample.iOS.csproj
├── SkiaImageView.Maui.Sample
├── App.xaml
├── App.xaml.cs
├── AppShell.xaml
├── AppShell.xaml.cs
├── MauiProgram.cs
├── Platforms
│ ├── Android
│ │ ├── AndroidManifest.xml
│ │ ├── MainActivity.cs
│ │ ├── MainApplication.cs
│ │ └── Resources
│ │ │ └── values
│ │ │ └── colors.xml
│ ├── MacCatalyst
│ │ ├── AppDelegate.cs
│ │ ├── Info.plist
│ │ └── Program.cs
│ ├── Tizen
│ │ ├── Main.cs
│ │ └── tizen-manifest.xml
│ ├── Windows
│ │ ├── App.xaml
│ │ ├── App.xaml.cs
│ │ ├── Package.appxmanifest
│ │ └── app.manifest
│ └── iOS
│ │ ├── AppDelegate.cs
│ │ ├── Info.plist
│ │ └── Program.cs
├── Properties
│ └── launchSettings.json
├── Resources
│ ├── AppIcon
│ │ ├── appicon.svg
│ │ └── appiconfg.svg
│ ├── Fonts
│ │ ├── OpenSans-Regular.ttf
│ │ └── OpenSans-Semibold.ttf
│ ├── Images
│ │ └── dotnet_bot.svg
│ ├── Raw
│ │ └── AboutAssets.txt
│ ├── Splash
│ │ └── splash.svg
│ └── Styles
│ │ ├── Colors.xaml
│ │ └── Styles.xaml
├── SkiaImageView.Maui.Sample.csproj
├── ViewModels
│ ├── ItemViewModel.cs
│ └── MainContentPageViewModel.cs
└── Views
│ ├── Converters
│ └── ScoreToBrushConverter.cs
│ ├── MainPage.xaml
│ └── MainPage.xaml.cs
├── SkiaImageView.Sample.Core
├── Models
│ ├── Cat.cs
│ └── TheCatAPI.cs
└── SkiaImageView.Sample.Core.csproj
├── SkiaImageView.Wpf.Sample
├── App.xaml
├── App.xaml.cs
├── Properties
│ └── AssemblyInfo.cs
├── SkiaImageView.Wpf.Sample.csproj
├── ViewModels
│ ├── ItemViewModel.cs
│ └── MainWindowViewModel.cs
└── Views
│ ├── Converters
│ └── ScoreToBrushConverter.cs
│ ├── MainWindow.xaml
│ └── MainWindow.xaml.cs
└── SkiaImageView.Xamarin.Forms.Sample
├── SkiaImageView.Xamarin.Forms.Sample.Android
├── Assets
│ └── AboutAssets.txt
├── MainActivity.cs
├── Properties
│ ├── AndroidManifest.xml
│ └── AssemblyInfo.cs
├── Resources
│ ├── AboutResources.txt
│ ├── Resource.designer.cs
│ ├── layout
│ │ ├── Tabbar.xml
│ │ └── Toolbar.xml
│ ├── mipmap-anydpi-v26
│ │ ├── icon.xml
│ │ └── icon_round.xml
│ ├── mipmap-hdpi
│ │ ├── icon.png
│ │ └── launcher_foreground.png
│ ├── mipmap-mdpi
│ │ ├── icon.png
│ │ └── launcher_foreground.png
│ ├── mipmap-xhdpi
│ │ ├── icon.png
│ │ └── launcher_foreground.png
│ ├── mipmap-xxhdpi
│ │ ├── icon.png
│ │ └── launcher_foreground.png
│ ├── mipmap-xxxhdpi
│ │ ├── icon.png
│ │ └── launcher_foreground.png
│ └── values
│ │ ├── colors.xml
│ │ └── styles.xml
└── SkiaImageView.Xamarin.Forms.Sample.Android.csproj
├── SkiaImageView.Xamarin.Forms.Sample.UI
├── App.xaml
├── App.xaml.cs
├── Properties
│ └── AssemblyInfo.cs
├── SkiaImageView.Xamarin.Forms.Sample.UI.csproj
├── ViewModels
│ ├── ItemViewModel.cs
│ └── MainContentPageViewModel.cs
└── Views
│ ├── Converters
│ └── ScoreToBrushConverter.cs
│ ├── MainPage.xaml
│ └── MainPage.xaml.cs
├── SkiaImageView.Xamarin.Forms.Sample.UWP
├── Assets
│ ├── LargeTile.scale-100.png
│ ├── LargeTile.scale-200.png
│ ├── LargeTile.scale-400.png
│ ├── SmallTile.scale-100.png
│ ├── SmallTile.scale-200.png
│ ├── SmallTile.scale-400.png
│ ├── SplashScreen.scale-100.png
│ ├── SplashScreen.scale-200.png
│ ├── SplashScreen.scale-400.png
│ ├── Square150x150Logo.scale-100.png
│ ├── Square150x150Logo.scale-200.png
│ ├── Square150x150Logo.scale-400.png
│ ├── Square44x44Logo.altform-unplated_targetsize-16.png
│ ├── Square44x44Logo.altform-unplated_targetsize-256.png
│ ├── Square44x44Logo.altform-unplated_targetsize-48.png
│ ├── Square44x44Logo.scale-100.png
│ ├── Square44x44Logo.scale-200.png
│ ├── Square44x44Logo.scale-400.png
│ ├── Square44x44Logo.targetsize-16.png
│ ├── Square44x44Logo.targetsize-256.png
│ ├── Square44x44Logo.targetsize-48.png
│ ├── StoreLogo.backup.png
│ ├── StoreLogo.scale-100.png
│ ├── StoreLogo.scale-200.png
│ ├── StoreLogo.scale-400.png
│ ├── Wide310x150Logo.scale-100.png
│ ├── Wide310x150Logo.scale-200.png
│ └── Wide310x150Logo.scale-400.png
├── MainPage.xaml
├── Package.appxmanifest
├── Properties
│ └── Default.rd.xml
├── SkiaImageView.Xamarin.Forms.Sample.UWP.csproj
├── UwpApp.xaml
└── UwpApp.xaml.cs
└── SkiaImageView.Xamarin.Forms.Sample.iOS
├── AppDelegate.cs
├── Assets.xcassets
└── AppIcon.appiconset
│ ├── Contents.json
│ ├── Icon1024.png
│ ├── Icon120.png
│ ├── Icon152.png
│ ├── Icon167.png
│ ├── Icon180.png
│ ├── Icon20.png
│ ├── Icon29.png
│ ├── Icon40.png
│ ├── Icon58.png
│ ├── Icon60.png
│ ├── Icon76.png
│ ├── Icon80.png
│ └── Icon87.png
├── Entitlements.plist
├── Info.plist
├── Main.cs
├── Properties
└── AssemblyInfo.cs
├── Resources
├── Default-568h@2x.png
├── Default-Portrait.png
├── Default-Portrait@2x.png
├── Default.png
├── Default@2x.png
└── LaunchScreen.storyboard
└── SkiaImageView.Xamarin.Forms.Sample.iOS.csproj
/Directory.Build.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | latest
5 | enable
6 | AnyCPU
7 |
8 | true
9 | true
10 | false
11 | false
12 | true
13 | git
14 | https://github.com/kekyo/SkiaImageView.git
15 |
16 | SkiaImageView
17 | false
18 | true
19 | $(NoWarn);CS1570;CS1591
20 |
21 | SkiaImageView
22 | SkiaImageView
23 | Copyright (c) Kouji Matsui
24 | Easy way showing SkiaSharp-based image objects onto UI applications.
25 | false
26 |
27 | Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud)
28 | Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud)
29 | Apache-2.0
30 | https://github.com/kekyo/SkiaImageView
31 | SkiaImageView.100.png
32 | .pdb
33 | $(NoWarn);NU1605;NU1701;NU1803
34 |
35 |
36 |
37 | portable
38 | false
39 | false
40 | false
41 |
42 |
43 |
44 | embedded
45 | true
46 | true
47 | true
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
--------------------------------------------------------------------------------
/Images/Japanese.256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kekyo/SkiaImageView/0f67423ed40044eeae64641cfffc6b99272a278f/Images/Japanese.256.png
--------------------------------------------------------------------------------
/Images/README.md:
--------------------------------------------------------------------------------
1 | The icon images imported from [FireFox emoji](https://github.com/mozilla/fxemoji).
2 | These items exclude FlashCap project copyright notice.
3 |
4 | ----
5 |
6 | ## License for the Code
7 |
8 | Copyright 2015, Mozilla Foundation
9 |
10 | Licensed under the Apache License, Version 2.0 (the "License");
11 | you may not use this file except in compliance with the License.
12 | You may obtain a copy of the License at
13 |
14 | http://www.apache.org/licenses/LICENSE-2.0
15 |
16 | Unless required by applicable law or agreed to in writing, software
17 | distributed under the License is distributed on an "AS IS" BASIS,
18 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 | See the License for the specific language governing permissions and
20 | limitations under the License.
21 |
22 |
23 |
24 | ## License for the Visual Design
25 |
26 | ### Creative Commons Attribution 4.0 International (CC BY 4.0)
27 | https://creativecommons.org/licenses/by/4.0/legalcode
28 | or for the human readable summary: https://creativecommons.org/licenses/by/4.0/
29 |
30 |
31 | #### You are free to:
32 | **Share** — copy and redistribute the material in any medium or format
33 | **Adapt** — remix, transform, and build upon the material for any purpose, even commercially.
34 | The licensor cannot revoke these freedoms as long as you follow the license terms.
35 |
36 |
37 | #### Under the following terms:
38 | **Attribution** — You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
39 | No additional restrictions — You may not apply legal terms or **technological measures** that legally restrict others from doing anything the license permits.
40 |
41 | #### Notices:
42 | You do not have to comply with the license for elements of the material in the public domain or where your use is permitted by an applicable exception or limitation. No warranties are given. The license may not give you all of the permissions necessary for your intended use. For example, other rights such as publicity, privacy, or moral rights may limit how you use the material.
43 |
--------------------------------------------------------------------------------
/Images/SkiaImageView.100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kekyo/SkiaImageView/0f67423ed40044eeae64641cfffc6b99272a278f/Images/SkiaImageView.100.png
--------------------------------------------------------------------------------
/Images/SkiaImageView.2048.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kekyo/SkiaImageView/0f67423ed40044eeae64641cfffc6b99272a278f/Images/SkiaImageView.2048.png
--------------------------------------------------------------------------------
/Images/u1F58C-lowerleftpaintbrush.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
36 |
--------------------------------------------------------------------------------
/SkiaImageView.Avalonia/BackingStore.cs:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////
2 | //
3 | // SkiaImageView - Easy way showing SkiaSharp-based image objects onto UI applications.
4 | //
5 | // Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud)
6 | //
7 | // Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0
8 | //
9 | ////////////////////////////////////////////////////////////////////////////
10 |
11 | using Avalonia;
12 | using Avalonia.Media;
13 | using Avalonia.Media.Imaging;
14 | using Avalonia.Platform;
15 | using SkiaSharp;
16 |
17 | namespace SkiaImageView
18 | {
19 | internal sealed class BackingStore
20 | {
21 | private readonly SKImageInfo imageInfo;
22 | private readonly WriteableBitmap writableBitmap;
23 | private ILockedFramebuffer? locker;
24 |
25 | public BackingStore(
26 | int width, int height, ProjectionQuality projectionQuality)
27 | {
28 | this.imageInfo = new(
29 | width, height, SKImageInfo.PlatformColorType, SKAlphaType.Premul);
30 | this.writableBitmap = new(
31 | new(imageInfo.Width, imageInfo.Height), new(96.0, 96.0), PixelFormat.Bgra8888, AlphaFormat.Premul);
32 | this.locker = this.writableBitmap.Lock();
33 | }
34 |
35 | public Size Size =>
36 | new(this.imageInfo.Width, this.imageInfo.Height);
37 |
38 | public void Finish()
39 | {
40 | this.locker!.Dispose();
41 | this.locker = null;
42 | }
43 |
44 | public SKSurface GetSurface() =>
45 | SKSurface.Create(this.imageInfo, this.locker!.Address, this.locker!.RowBytes);
46 |
47 | public void Draw(DrawingContext drawingContext, Size renderSize) =>
48 | drawingContext.DrawImage(this.writableBitmap, new(new(), renderSize));
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/SkiaImageView.Avalonia/Interops.cs:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////
2 | //
3 | // SkiaImageView - Easy way showing SkiaSharp-based image objects onto UI applications.
4 | //
5 | // Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud)
6 | //
7 | // Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0
8 | //
9 | ////////////////////////////////////////////////////////////////////////////
10 |
11 | using Avalonia;
12 | using Avalonia.Data;
13 | using Avalonia.Reactive;
14 | using Avalonia.Threading;
15 | using System;
16 |
17 | namespace SkiaImageView;
18 |
19 | internal static class Interops
20 | {
21 | #if AVALONIA
22 | public static AvaloniaProperty Register(
23 | string memberName, TTarget defaultValue, Action changed)
24 | where THost : IAvaloniaObject =>
25 | AvaloniaProperty.Register(
26 | memberName, defaultValue, false, BindingMode.OneWay,
27 | null,
28 | null,
29 | (s, isChanged) =>
30 | {
31 | if (isChanged)
32 | {
33 | changed((THost)s);
34 | }
35 | });
36 |
37 | public static Dispatcher GetDispatcher(
38 | this IAvaloniaObject _) =>
39 | Dispatcher.UIThread;
40 | #else
41 |
42 | // The same AvaloniaProperty should not be registered twice
43 | #pragma warning disable AVP1001
44 |
45 | public static AvaloniaProperty Register(
46 | string memberName, TTarget defaultValue, Action changed)
47 | where THost : AvaloniaObject
48 | {
49 | var ap = AvaloniaProperty.Register(
50 | memberName, defaultValue, false, BindingMode.OneWay,
51 | null,
52 | null,
53 | false);
54 |
55 | ap.Changed.Subscribe(new AnonymousObserver>(
56 | e => changed((THost)e.Sender)));
57 |
58 | return ap;
59 | }
60 |
61 | public static Dispatcher GetDispatcher(
62 | this AvaloniaObject _) =>
63 | Dispatcher.UIThread;
64 | #endif
65 |
66 | public static void InvokeAsynchronously(
67 | this Dispatcher dispatcher, Action action, bool isHigherPriority) =>
68 | dispatcher.InvokeAsynchronously(
69 | action,
70 | isHigherPriority);
71 | }
72 |
--------------------------------------------------------------------------------
/SkiaImageView.Avalonia/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////
2 | //
3 | // SkiaImageView - Easy way showing SkiaSharp-based image objects onto UI applications.
4 | //
5 | // Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud)
6 | //
7 | // Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0
8 | //
9 | ////////////////////////////////////////////////////////////////////////////
10 |
11 | using Avalonia.Metadata;
12 |
13 | [assembly: XmlnsDefinition("https://github.com/kekyo/SkiaImageView", "SkiaImageView")]
14 | [assembly: XmlnsPrefix("https://github.com/kekyo/SkiaImageView", "siv")]
15 |
--------------------------------------------------------------------------------
/SkiaImageView.Avalonia/SKImageView.cs:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////
2 | //
3 | // SkiaImageView - Easy way showing SkiaSharp-based image objects onto UI applications.
4 | //
5 | // Copyright (c) Kouji Matsui (@kozy_kekyo, @kekyo@mastodon.cloud)
6 | //
7 | // Licensed under Apache-v2: https://opensource.org/licenses/Apache-2.0
8 | //
9 | ////////////////////////////////////////////////////////////////////////////
10 |
11 | using Avalonia;
12 | using Avalonia.Controls;
13 | using Avalonia.Media;
14 | using Avalonia.Metadata;
15 |
16 | namespace SkiaImageView;
17 |
18 | partial class SKImageView : Control
19 | {
20 | public static readonly AvaloniaProperty