mirror of
https://github.com/crskycode/GARbro.git
synced 2024-12-24 03:44:13 +08:00
(ImageData.Create): allow custom stride.
This commit is contained in:
parent
57b0115d41
commit
6ba6526536
@ -83,14 +83,19 @@ namespace GameRes
|
||||
}
|
||||
|
||||
public static ImageData Create (ImageMetaData info, PixelFormat format, BitmapPalette palette,
|
||||
byte[] pixel_data)
|
||||
byte[] pixel_data, int stride)
|
||||
{
|
||||
int stride = (int)info.Width*((format.BitsPerPixel+7)/8);
|
||||
var bitmap = BitmapSource.Create ((int)info.Width, (int)info.Height, DefaultDpiX, DefaultDpiY,
|
||||
format, palette, pixel_data, stride);
|
||||
bitmap.Freeze();
|
||||
return new ImageData (bitmap, info);
|
||||
}
|
||||
|
||||
public static ImageData Create (ImageMetaData info, PixelFormat format, BitmapPalette palette,
|
||||
byte[] pixel_data)
|
||||
{
|
||||
return Create (info, format, palette, pixel_data, (int)info.Width*((format.BitsPerPixel+7)/8));
|
||||
}
|
||||
}
|
||||
|
||||
public abstract class ImageFormat : IResource
|
||||
|
Loading…
x
Reference in New Issue
Block a user