Example #1
0
 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);
 }
Example #2
0
 public static ImageData Create(ImageMetaData info, PixelFormat format, BitmapPalette palette,
                                 byte[] pixel_data)
 {
     return Create(info, format, palette, pixel_data, (int)info.Width * ((format.BitsPerPixel + 7) / 8));
 }
Example #3
0
 public static ImageData Create(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);
     bitmap.Freeze();
     return new ImageData(bitmap, info);
 }
Example #4
0
 public ImageData(BitmapSource data, ImageMetaData meta)
 {
     m_bitmap = data;
     OffsetX = meta.OffsetX;
     OffsetY = meta.OffsetY;
 }
Example #5
0
 public static ImageData Create(ImageMetaData info, PixelFormat format, BitmapPalette palette,
                                byte[] pixel_data)
 {
     return(Create(info, format, palette, pixel_data, (int)info.Width * ((format.BitsPerPixel + 7) / 8)));
 }
Example #6
0
 public ImageData(BitmapSource data, ImageMetaData meta)
 {
     m_bitmap = data;
     OffsetX  = meta.OffsetX;
     OffsetY  = meta.OffsetY;
 }