Open
Description
Description
The overload of SKPixmap
public bool Encode(Stream dst, SKEncodedImageFormat encoder, int quality)
is producing a black bar that is cropping the bottom part, but when i use this overload
public SKData Encode(SKEncodedImageFormat encoder, int quality)
and manually save the SKData
its fine without cropping the bottom part.
It might have been a SKManagedWStream
issue.
Code
var pxs = Marshal.AllocHGlobal(skInfo.BytesSize);
var bmp2 = new SKPixmap(skInfo.WithSize(640, 640), pxs);
image.ScalePixels(bmp2, SKSamplingOptions.Default);
bmp2.Encode(File.Create("save2.png"), SKEncodedImageFormat.Png, 100);
var enc = bmp2.Encode(SKEncodedImageFormat.Png, 100);
var f = File.Create("save3.png");
enc.SaveTo(f);
Expected Behavior
No black bar just like save3.png
Actual Behavior
Produces a black bar at the bottom for save2.png
Version of SkiaSharp
3.116.0 (Current)
Last Known Good Version of SkiaSharp
3.116.0 (Current)
IDE / Editor
Visual Studio (Windows)
Platform / Operating System
Windows
Platform / Operating System Version
No response
Devices
No response
Relevant Screenshots
Save2.png
Save3.png
Relevant Log Output
No response
Code of Conduct
- I agree to follow this project's Code of Conduct
Metadata
Assignees
Type
Projects
Status
New
Activity