From 73c46881482d31b4745f722768a0c9284fb1f32f Mon Sep 17 00:00:00 2001 From: morkt Date: Sun, 26 Nov 2017 16:58:43 +0400 Subject: [PATCH] (ImageData.Create): accept Array object as pixels array. --- GameRes/Image.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/GameRes/Image.cs b/GameRes/Image.cs index d5857606..1d05401b 100644 --- a/GameRes/Image.cs +++ b/GameRes/Image.cs @@ -99,7 +99,7 @@ namespace GameRes } public static ImageData Create (ImageMetaData info, PixelFormat format, BitmapPalette palette, - byte[] pixel_data, int stride) + Array pixel_data, int stride) { var bitmap = BitmapSource.Create ((int)info.Width, (int)info.Height, DefaultDpiX, DefaultDpiY, format, palette, pixel_data, stride); @@ -108,13 +108,13 @@ namespace GameRes } public static ImageData Create (ImageMetaData info, PixelFormat format, BitmapPalette palette, - byte[] pixel_data) + Array pixel_data) { return Create (info, format, palette, pixel_data, (int)info.Width*((format.BitsPerPixel+7)/8)); } public static ImageData CreateFlipped (ImageMetaData info, PixelFormat format, BitmapPalette palette, - byte[] pixel_data, int stride) + Array pixel_data, int stride) { var bitmap = BitmapSource.Create ((int)info.Width, (int)info.Height, DefaultDpiX, DefaultDpiY, format, palette, pixel_data, stride);