public static BitmapSource ToWpf(this Graphics.Bitmap bitmap) { // HACK(adm244): get rid of transparent alpha channel //if (bitmap.Format == Graphics.Formats.PixelFormat.Argb32) // bitmap = bitmap.Convert(Graphics.Formats.PixelFormat.Rgb24); byte[] buffer = bitmap.GetPixels(); int stride = bitmap.Width * bitmap.BytesPerPixel; return(BitmapSource.Create(bitmap.Width, bitmap.Height, 96, 96, bitmap.Format.ToWpf(), bitmap.Palette?.ToWpf(), buffer, stride)); }
public void ChangeFrame(int index, Graphics.Bitmap bitmap) { Frames[index].ChangeImage(bitmap); }
public void ChangeFrame(int index, Graphics.Bitmap bitmap) { BaseRoom.Background.Frames[index] = bitmap; Background.ChangeFrame(index, bitmap); }