use ImageData.Create method instead of BitmapSource.Create.

This commit is contained in:
morkt
2015-10-12 12:16:23 +04:00
parent 43b1631e67
commit 2d1f18903a
16 changed files with 22 additions and 95 deletions

View File

@@ -78,11 +78,7 @@ namespace GameRes.Formats.BlackRainbow
{
PixelFormat format = meta.Flag != 0 ? PixelFormats.Bgra32 : PixelFormats.Bgr32;
reader.Unpack();
byte[] pixels = reader.Data;
var bitmap = BitmapSource.Create ((int)meta.Width, (int)meta.Height, 96, 96,
format, null, pixels, (int)meta.Width*4);
bitmap.Freeze();
return new ImageData (bitmap, meta);
return ImageData.Create (meta, format, null, reader.Data, (int)meta.Width*4);
}
}