We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi,
We utilize the SkiaSharp library within one of our commercial DevExpress products to offer cross-platform drawing and printing functionalities.
Upon executing the code below, we notice a discrepancy in the resulting figure compared to the one generated using GDI+ functionality.
Although I am not sure whether this behavior is a bug, I would greatly appreciate any suggestions or recommendations on how to resolve this issue.
SKPoint[] points = new SKPoint[] { new SKPoint(-6388600, 3162518), new SKPoint(-6010237, 6388600), new SKPoint(639, 40), new SKPoint(639, 40), }; using (SKBitmap bmp = new SKBitmap(650, 350)) { using (SKCanvas canvas = new SKCanvas(bmp)) using (SKPaint paint = new SKPaint()) using (SKPath path = new SKPath()) { paint.Style = SKPaintStyle.Stroke; paint.StrokeWidth = 2; paint.StrokeMiter = 10; paint.Color = SKColors.Red; canvas.Clear(SKColors.White); path.MoveTo(points[0]); path.CubicTo(points[1], points[2], points[3]); canvas.DrawPath(path, paint); } string savePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), "skia.png"); using (FileStream stream = File.OpenWrite(savePath)) using (SKPixmap pixmap = bmp.PeekPixels()) { const int compression = 5; SKPngEncoderOptions options = new SKPngEncoderOptions(SKPngEncoderFilterFlags.None, zLibLevel: compression); using (SKManagedWStream skStream = new SKManagedWStream(stream, false)) pixmap.Encode(skStream, options); } }
This is the result we obtain when we call GDI+ methods:
using (Image image = new Bitmap(650, 350)) { using (Graphics graphics = Graphics.FromImage(image)) { PointF[] points = new PointF[] { new PointF(-6388600, 3162518), new PointF(-6010237, 6388600), new PointF(639, 40), new PointF(639, 40), }; graphics.Clear(Color.White); graphics.DrawBeziers(new Pen(Color.Red, 2), points); } string path = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), "gdi+.png"); image.Save(path, ImageFormat.Png); }
This is the result with SkiaSharp:
3.116.0 (Current)
Other (Please indicate in the description)
Visual Studio (Windows)
Windows
No response
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Description
Hi,
We utilize the SkiaSharp library within one of our commercial DevExpress products to offer cross-platform drawing and printing functionalities.
Upon executing the code below, we notice a discrepancy in the resulting figure compared to the one generated using GDI+ functionality.
Although I am not sure whether this behavior is a bug, I would greatly appreciate any suggestions or recommendations on how to resolve this issue.
Code
Expected Behavior
This is the result we obtain when we call GDI+ methods:
Actual Behavior
This is the result with SkiaSharp:
Version of SkiaSharp
3.116.0 (Current)
Last Known Good Version of SkiaSharp
Other (Please indicate in the description)
IDE / Editor
Visual Studio (Windows)
Platform / Operating System
Windows
Platform / Operating System Version
No response
Devices
No response
Relevant Screenshots
No response
Relevant Log Output
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: