Exemple #1
0
        public static BitmapSource GetBimapSource(this IImageRead imageRead)
        {
            const double dpi = 96.0;

            var size = imageRead.Size;
            var data = imageRead.ToBgra32();

            return(BitmapSource.Create(size.Width, size.Height, dpi, dpi, PixelFormats.Bgra32, null, data, size.Width * 4));
        }
Exemple #2
0
 public ISpriteTexture CreateSpriteTexture(IImageRead image) =>
 CreateSpriteTexture(image.Size.Width, image.Size.Height, image.ToBgra32());