Пример #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());
        }