public void Clear(ArgbColor?argbColor = null) { using (var brush = new SolidBrush(argbColor.HasValue ? argbColor.Value.ToGdiColor() : Color.White)) { _graphics.FillRectangle(brush, _bounds.ToGdiRectangle()); } }
public void DrawBitmap(IBitmap bitmap, CanvasRectangle dest, CanvasRectangle source, float opacity = 1.0f) { CheckUsability(); var imageAttributes = CreateImageAttributes(opacity); if (imageAttributes != null) { _graphics.DrawImage((Bitmap)bitmap.EngineElement, dest.ToGdiRectangle(), source.Left, source.Top, source.Width, source.Height, System.Drawing.GraphicsUnit.Pixel, imageAttrs: imageAttributes); } else { _graphics.DrawImage((Bitmap)bitmap.EngineElement, dest.ToGdiRectangle(), source.ToGdiRectangle(), System.Drawing.GraphicsUnit.Pixel); } }
public void FillRectangle(IBrush brush, CanvasRectangle rectangle) { CheckUsability(); _graphics.FillRectangle((Brush)brush.EngineElement, rectangle.ToGdiRectangle()); }
public void DrawRectangle(IPen pen, CanvasRectangle rectangle) { CheckUsability(); _graphics.DrawRectangle((Pen)pen.EngineElement, rectangle.ToGdiRectangle()); }