mirror of
https://github.com/crskycode/GARbro.git
synced 2026-07-08 01:30:18 +08:00
use ImageData.Create method instead of BitmapSource.Create.
This commit is contained in:
@@ -100,11 +100,7 @@ namespace GameRes.Formats.Silky
|
||||
format = PixelFormats.Bgra32;
|
||||
else
|
||||
format = PixelFormats.Gray8;
|
||||
var bitmap = BitmapSource.Create ((int)info.Width, (int)info.Height,
|
||||
ImageData.DefaultDpiX, ImageData.DefaultDpiY, format, null, pixels, stride);
|
||||
var flipped = new TransformedBitmap (bitmap, new ScaleTransform { ScaleY = -1 });
|
||||
flipped.Freeze();
|
||||
return new ImageData (flipped, info);
|
||||
return ImageData.CreateFlipped (info, format, null, pixels, stride);
|
||||
}
|
||||
|
||||
public override void Write (Stream file, ImageData image)
|
||||
|
||||
@@ -107,10 +107,7 @@ namespace GameRes.Formats.Silky
|
||||
format = PixelFormats.Bgr24;
|
||||
else
|
||||
format = PixelFormats.Bgra32;
|
||||
var bitmap = BitmapSource.Create ((int)info.Width, (int)info.Height, 96, 96,
|
||||
format, null, pixels, meta.Stride);
|
||||
bitmap.Freeze();
|
||||
return new ImageData (bitmap, info);
|
||||
return ImageData.Create (info, format, null, pixels, meta.Stride);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user