public static SDI.PixelFormat ToPixelFormat(this ImageFormat self) { switch (self) { case ImageFormat.ARGB32: return(SDI.PixelFormat.Format32bppArgb); case ImageFormat.RGB24: return(SDI.PixelFormat.Format24bppRgb); default: throw new ArgumentException(); } }
public GdiImage(int width, int height, XD.ImageFormat format) { this.Image = new SD.Bitmap(width, height, format.ToGdi()); }
public object ConvertToBitmap(double width, double height, double scaleFactor, XD.ImageFormat format) { if (_drawCallback != null) { var image = new SD.Bitmap((int)width, (int)height, format.ToGdi()); using (var g = SD.Graphics.FromImage(image)) { g.SetQuality(GdiConverter.PaintHighQuality); g.ScaleTransform((float)scaleFactor, (float)scaleFactor); Draw(g, 0, 0, width, height); g.Flush(); } return(new GdiImage(image)); } throw new NotSupportedException(); }
public override object ConvertToBitmap(ImageDescription idesc, double scaleFactor, XD.ImageFormat format) { var image = (GdiImage)idesc.Backend; return(image.ConvertToBitmap(idesc.Size.Width, idesc.Size.Height, scaleFactor, format)); }