From 43b1631e671a4e7bbd28528ea2b5e6432c54b9cf Mon Sep 17 00:00:00 2001 From: morkt Date: Mon, 12 Oct 2015 12:14:57 +0400 Subject: [PATCH] (ImageData.CreateFlipped): new static method. --- GameRes/Image.cs | 10 ++++++++++ GameRes/Properties/AssemblyInfo.cs | 4 ++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/GameRes/Image.cs b/GameRes/Image.cs index 6c1723e3..562bf367 100644 --- a/GameRes/Image.cs +++ b/GameRes/Image.cs @@ -99,6 +99,16 @@ namespace GameRes { 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) + { + var bitmap = BitmapSource.Create ((int)info.Width, (int)info.Height, DefaultDpiX, DefaultDpiY, + format, palette, pixel_data, stride); + var flipped = new TransformedBitmap (bitmap, new ScaleTransform { ScaleY = -1 }); + flipped.Freeze(); + return new ImageData (flipped, info); + } } public abstract class ImageFormat : IResource diff --git a/GameRes/Properties/AssemblyInfo.cs b/GameRes/Properties/AssemblyInfo.cs index 9c5efa1c..daca1732 100644 --- a/GameRes/Properties/AssemblyInfo.cs +++ b/GameRes/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion ("1.2.8.108")] -[assembly: AssemblyFileVersion ("1.2.8.108")] +[assembly: AssemblyVersion ("1.2.8.110")] +[assembly: AssemblyFileVersion ("1.2.8.110")]