Exemplo n.º 1
0
        private void PrepareBuffer()
        {
            ClearBuffer();

            _image = new Bitmap(_size.Width, _size.Height, PixelFormat.Format16bppRgb565);
            _graphics = Graphics.FromImage(_image);
            _drawingGraphics = DrawingGraphics.FromGraphicsAndRect(_graphics, _image,
                    new Rectangle(0, 0, _image.Width, _image.Height));
        }
Exemplo n.º 2
0
 private void ClearBuffer()
 {
     if (_graphics != null)
     {
         _graphics.Dispose();
         _graphics = null;
     }
     if (_image != null)
     {
         _image.Dispose();
         _image = null;
     }
     _drawingGraphics = null;
 }
Exemplo n.º 3
0
 public static DrawingGraphics FromPaintEventArgs(PaintEventArgs e, Image canvasImage)
 {
     return(DrawingGraphics.FromGraphicsAndRect(e.Graphics, canvasImage, e.ClipRectangle));
 }