public void DrawImage(object backend, object img, Rectangle srcRect, Rectangle destRect, double alpha) { var c = (DrawingContext)backend; Bitmap bmp = DataConverter.AsBitmap(img); DrawImageCore(c.Graphics, bmp, srcRect, destRect, (float)alpha); }
public void DrawImage(object backend, object img, double x, double y, double width, double height, double alpha) { var c = (DrawingContext)backend; Bitmap bmp = DataConverter.AsBitmap(img); DrawImageCore(c.Graphics, bmp, (float)x, (float)y, (float)width, (float)height, (float)alpha); }
public override object ChangeOpacity (object backend, double opacity) { Bitmap bitmap = DataConverter.AsBitmap (backend); if (bitmap == null) throw new ArgumentException (); Bitmap result = new Bitmap (bitmap.Width, bitmap.Height, bitmap.PixelFormat); Graphics g = Graphics.FromImage (result); ContextBackendHandler.DrawImageCore (g, bitmap, 0, 0, bitmap.Width, bitmap.Height, (float)opacity); g.Dispose (); return result; }
public object Create(object img) { Bitmap bmp = DataConverter.AsBitmap(img); return(new TextureBrush(bmp, System.Drawing.Drawing2D.WrapMode.Tile)); }