| ■No87706 (Take さん) に返信 > protected override void OnPaint(PaintEventArgs pe) > { > base.OnPaint(pe); > Bitmap bmp = new Bitmap(this.Size.Width, this.Size.Height); > Graphics grp = Graphics.FromImage(bmp); > 色々と描画 > pe.Graphics.DrawImage(bmp, new Point(0, 0)); > }
Bitmap や Graphics の解放が漏れていませんか?
using(Bitmap bmp = new Bitmap(this.Size.Width, this.Size.Height)) using(Graphics grp = Graphics.FromImage(bmp)) { 色々と描画 pe.Graphics.DrawImage(bmp, new Point(0, 0)); }
|