Пример #1
0
        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();
        }
Пример #2
0
 public GdiImage(int width, int height, XD.ImageFormat format)
 {
     this.Image = new SD.Bitmap(width, height, format.ToGdi());
 }