mirror of
https://github.com/crskycode/GARbro.git
synced 2026-06-08 14:49:14 +08:00
added BitmapSourceDecoder class.
This commit is contained in:
@@ -25,6 +25,7 @@
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Windows.Media.Imaging;
|
||||
|
||||
namespace GameRes
|
||||
{
|
||||
@@ -165,4 +166,26 @@ namespace GameRes
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
public class BitmapSourceDecoder : IImageDecoder
|
||||
{
|
||||
public Stream Source { get; set; }
|
||||
public ImageFormat SourceFormat { get; set; }
|
||||
public ImageMetaData Info { get; private set; }
|
||||
public ImageData Image { get; private set; }
|
||||
|
||||
public BitmapSourceDecoder (BitmapSource bitmap)
|
||||
{
|
||||
Info = new ImageMetaData {
|
||||
Width = (uint)bitmap.PixelWidth,
|
||||
Height = (uint)bitmap.PixelHeight,
|
||||
BPP = bitmap.Format.BitsPerPixel,
|
||||
};
|
||||
Image = new ImageData (bitmap);
|
||||
}
|
||||
|
||||
public void Dispose ()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user