private void CreateAndPaintCachedImage( Image image, ClientPaintMethod paintMethod, Graphics g) { if (image == null) { image = new Bitmap(Width, Height); Graphics bufferedGraphics = Graphics.FromImage(image); paintMethod(bufferedGraphics); bufferedGraphics.Dispose(); } g.DrawImageUnscaled(image, new Point(0, 0)); }
private void CreateAndPaintCachedImage( Image image, ClientPaintMethod paintMethod, Graphics g) { if (image == null) { image = new Bitmap(Width, Height); Graphics bufferedGraphics = Graphics.FromImage(image); paintMethod(bufferedGraphics); bufferedGraphics.Dispose(); } g.DrawImageUnscaled(image, 0, 0); }