protected void PerformRender() { if (bitmap != null) bitmap.Dispose(); bitmap = new System.Drawing.Bitmap((int)W, (int)H, System.Drawing.Imaging.PixelFormat.Format32bppArgb); System.Drawing.Graphics wg = System.Drawing.Graphics.FromImage(bitmap); wg.Clear(System.Drawing.Color.Transparent); WindowsGraphics g = new WindowsGraphics(wg, W, H); if (this.Render != null) this.Render(this, new RenderEventArgs(g)); g.Dispose(); wg.Dispose(); UpdatePPMask(bitmap); }
protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) { //if (Framed) //{ WindowsGraphics g = new WindowsGraphics(e.Graphics, W, H); if (this.Render != null) this.Render(this, new RenderEventArgs(g)); g.Dispose(); //} //else // base.OnPaint(e); }