Pre Merge pull request !4 from jasper/Optimize-AllocatePixels

This commit is contained in:
jasper 2024-06-25 14:17:06 +00:00 committed by Gitee
commit 87c583cf1b
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -126,8 +126,8 @@ namespace CPF.Skia
BITMAP BITMAP = new BITMAP();
UnmanagedMethods.GetObject(hbitmap, Marshal.SizeOf(typeof(BITMAP)), BITMAP);
var bitmap = new SKBitmap(BITMAP.bmWidth, BITMAP.bmHeight);
bitmap.SetPixels(BITMAP.bmBits);
var bitmap = new SKBitmap();
bitmap.InstallPixels(new SKImageInfo(BITMAP.bmWidth, BITMAP.bmHeight, SKImageInfo.PlatformColorType), BITMAP.bmBits, BITMAP.bmWidthBytes);
this.bitmap = bitmap;
canvas = new SKCanvas(this.bitmap);