public override void ChangeFormat(Core.DomainObjects.ImageFormat.ImageFormatType imageFormat) { ImageFormat bitmapImageFormat = null; if (imageFormat == Core.DomainObjects.ImageFormat.ImageFormatType.gif) { bitmapImageFormat = ImageFormat.Gif; } else if (imageFormat == Core.DomainObjects.ImageFormat.ImageFormatType.jpg) { bitmapImageFormat = ImageFormat.Jpeg; } else if (imageFormat == Core.DomainObjects.ImageFormat.ImageFormatType.png) { bitmapImageFormat = ImageFormat.Png; } platformBitmap = ChangeFormat(bitmapImageFormat); }
public override void Set(Stream stream) { platformBitmap = new Drawing.Bitmap(stream); platformBitmap.GetPixel(0, 0); // TODO: this is magic line that prevents calls to GetPixel from crashing when doing the encode }