예제 #1
0
 public void Clear(ArgbColor?argbColor = null)
 {
     using (var brush = new SolidBrush(argbColor.HasValue ? argbColor.Value.ToGdiColor() : Color.White))
     {
         _graphics.FillRectangle(brush, _bounds.ToGdiRectangle());
     }
 }
예제 #2
0
        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);
            }
        }
예제 #3
0
        public void FillRectangle(IBrush brush, CanvasRectangle rectangle)
        {
            CheckUsability();

            _graphics.FillRectangle((Brush)brush.EngineElement, rectangle.ToGdiRectangle());
        }
예제 #4
0
        public void DrawRectangle(IPen pen, CanvasRectangle rectangle)
        {
            CheckUsability();

            _graphics.DrawRectangle((Pen)pen.EngineElement, rectangle.ToGdiRectangle());
        }