skiasharp Questions

2

We are using .NET 7 and SkiaSharp 2.88.3. We have the following controller action which is used to retrieve a .jpg or .png image from disk and scale it according to scaleFactor parameter (1.0 means...
Customhouse asked 4/9, 2023 at 11:38

3

I've built a .NET Core 6 application that runs without issue on my local Windows 11 machine. I've deployed it to an Ubuntu 20.04 server and I receive an error that it cannot load the libSkiaSharp s...
Koodoo asked 10/2, 2023 at 18:55

3

Solved

I'm trying to use SkiaSharp to convert an SVG file to PNG. I know there are many alternatives, but I wanted to evaluate it's SVG load support. Is this possible? I tried this: var svg = new SKSvg(...
Wallaroo asked 12/2, 2017 at 1:21

2

Solved

SkiaSharp fails at runtime when deployed to an alpine linux container, using .NET 6.0 with the following error: System.TypeInitializationException: The type initializer for 'SkiaSharp.SKImageInfo'...
Actinomycete asked 14/10, 2022 at 0:35

2

Solved

I am trying to replace GDI+ with SkiaSharp for a data visualization framework that renders multi-layered pannable-zoomable graphs with real-time continuously changing engineering data. In GDI+, the...
Caston asked 8/11, 2020 at 11:37

5

I am hoping to port an Electron app over to Avalonia. The app currently uses Paper.js to draw and manage interactions with complex polygons. Looking into Avalonia, I noticed it uses Skia, which see...
Ruddle asked 6/5, 2020 at 4:22

3

Solved

I am attempting to use/convert the SKBitmap image as/to an ImageSource object in order to use the aforementioned image in a Button by assignment to its ImageSource property but, for the life of me,...
Racon asked 6/8, 2020 at 23:27

5

Solved

I'm using the SKBitmap.Resize() method in SkiaSharp on a Xamarin.Forms project to resize images for display. The problem I'm encountering is when taking a photo on iOS, when a photo is taken in por...
Skolnik asked 25/5, 2017 at 13:33

1

An extension of this question. I'm using SkiaSharp to draw shapes with OpenGL. Most of code samples for WPF suggest using SKElement control and get reference to the drawing surface inside PaintSurf...
Suchta asked 29/12, 2020 at 16:28

2

Solved

I'm not clear on how SKBitmap.InstallPixels() and SKBitmap.SetPixels() work. Here's the documentation for one of each method (there are several method overloads): // Summary: // Installs the speci...
Snicker asked 14/4, 2020 at 1:15

1

I have some existing C# code that uses System.Drawing.Common to measure the approximate width of a string in pixels: var text = "abc123 this is some long text my dog's name is fido."; us...
Somnambulate asked 10/11, 2021 at 3:35

1

I'm using SkiaSharp to print labels to PDF (and other things). Each page of the PDF can have multiple rows and columns. I need to clip each label to the correct size so it's doesn't trash neighbour...
Damicke asked 16/5, 2018 at 12:54

1

Solved

I know a SkiaSharp canvas can be placed in a Grid in a Xamarin App. Here is some example (working) code: xmlns:skia="clr-namespace:SkiaSharp.Views.Forms;assembly=SkiaSharp.Views.Forms" &...
Nickelsen asked 29/8, 2020 at 2:12

2

Solved

Using SkiaSharp 1.68.0 with .NET Core 2.2 on Linux and get this error when trying to use Decode on a jpeg-memory-stream (same code works on Windows): System.TypeInitializationException: The type i...
Restrictive asked 9/12, 2018 at 13:53

0

I need to create a simple app to draw a graph network onto a canvas. As I use .net core it seems that one of the best solutions could be Avalonia + Skia backend. The problem is that I haven't found...
Windtight asked 28/4, 2020 at 18:26

2

Solved

I have a question. I have a skiasharp canvas with a few bitmaps. Now I want to export the canvas with the bitmaps to an Image, but I have no idea how to do that, or if that is possible. Can ...

0

I'm using SkiaSharp to resize an existing image. On resize I'd like to be able to test/set the quality on different levels. Here's my code: public static class ResizeImage { public static strin...
Brigantine asked 12/11, 2019 at 23:23

2

Solved

I'm trying to rotate photo with SkiaSharp to 90 degrees with following code: public SKBitmap Rotate() { var bitmap = SKBitmap.Decode("test.jpg"); using (var surface = new SKCanvas(bitmap)) { ...
Folkrock asked 13/7, 2017 at 9:46

2

I tried compiling skia on Windows as suggested in https://skia.org/user/build bin/gn gen out/Static --args='is_official_build=true' ninja -C out/Static Build fails to find libjpeg.h, libpng.h T...
Northeast asked 8/5, 2018 at 7:54

1

Solved

My goal is to calculate the drag of a users finger around a center point of a scren and I've tried a few bad attempts using Math.Atan2(). FYI I am using SkiaSharp in Xamarin applications but to kee...
Miliary asked 20/1, 2019 at 19:20

0

How to make an onclick function on a skiashark stroke? I have made a circle graph with multiple paths: https://i.sstatic.net/ngiz6.jpg For example the green line: SKPaint paint4 = new SKPaint {...
Faydra asked 19/9, 2018 at 14:49

2

How to use a custom font in skiasharp from Xamarin forms. I tried paint.Typeface = SKTypeface.FromFamilyName("CoText_Bd"); and paint.Typeface = SKTypeface.FromFile("CoText_Bd"); But both...

1

I'm looking for the fastest way to resize an SKImage. Unfortunately I found a few examples. I ask this because if I perform these functions in parallel (in my case about 60 threads) the execution ...
Scorch asked 24/1, 2018 at 12:38

1

Solved

In System.Drawing we retrieve the PixelFormat from Image object, but SkiaSharp.SkImage does not provide API to find the PixelFormat of decoded image. Whether it has any other workaround to find the...
Dukie asked 26/12, 2017 at 10:7

1

Solved

SKBitmap.Bytes is read only, any suggestion on how to Marshal.Copy a byte array to the SKBitmap? I am using below code snippet but it not working. Code snippet: SKBitmap bitmap = new SKBitmap((int...
Parshall asked 29/12, 2017 at 4:13

© 2022 - 2024 — McMap. All rights reserved.