From: Jeff R. <jef...@us...> - 2005-09-11 18:31:17
|
Update of /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SvgComponents In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18931/src/SvgComponents Modified Files: SvgPictureBox.cs Log Message: Modified painting functions to support a Draw Command, relative positions and handle Garbage Collection Index: SvgPictureBox.cs =================================================================== RCS file: /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SvgComponents/SvgPictureBox.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SvgPictureBox.cs 6 Mar 2005 08:17:14 -0000 1.1 --- SvgPictureBox.cs 11 Sep 2005 18:31:10 -0000 1.2 *************** *** 132,135 **** --- 132,141 ---- { #endif + + // Worry about clearing the graphics nodes map... + renderer.ClearMap(); + System.GC.Collect(); + System.Threading.Thread.Sleep(1); + if(value != null && value.Length > 0) { *************** *** 195,198 **** --- 201,206 ---- if ( this.window != null ) { renderAndInvalidate(); + System.GC.Collect(); + System.Threading.Thread.Sleep(1); } } *************** *** 246,254 **** if (surface != null) ! paint(surface); else { surface = CreateGraphics(); ! paint(surface); surface.Dispose(); surface = null; --- 254,262 ---- if (surface != null) ! Draw(surface); else { surface = CreateGraphics(); ! Draw(surface); surface.Dispose(); surface = null; *************** *** 279,287 **** if (surface != null) ! paint(surface, rect); else { surface = CreateGraphics(); ! paint(surface, rect); surface.Dispose(); surface = null; --- 287,295 ---- if (surface != null) ! Draw(surface, rect); else { surface = CreateGraphics(); ! Draw(surface, rect); surface.Dispose(); surface = null; *************** *** 297,301 **** } ! private void paint(Graphics gr) { if ( !this.DesignMode ) --- 305,309 ---- } ! public void Draw(Graphics gr) { if ( !this.DesignMode ) *************** *** 313,317 **** } ! private void paint(Graphics gr, RectangleF rect) { if ( !this.DesignMode ) --- 321,341 ---- } ! public void Draw(Graphics gr, int offsetX, int offsetY) ! { ! if ( !this.DesignMode ) ! { ! if ( window != null ) ! { ! Bitmap rasterImage = ((GdiRenderer) window.Renderer).RasterImage; ! ! if ( rasterImage != null ) ! { ! gr.DrawImage(rasterImage, offsetX, offsetY, rasterImage.Width, rasterImage.Height); ! } ! } ! } ! } ! ! public void Draw(Graphics gr, RectangleF rect) { if ( !this.DesignMode ) *************** *** 331,335 **** protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) { ! paint(e.Graphics); } --- 355,364 ---- protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) { ! if (surface != null) ! { ! Draw(surface); ! } ! else ! Draw(e.Graphics); } *************** *** 339,342 **** --- 368,375 ---- if (loaded) { + // Worry about clearing the graphics nodes map... + System.GC.Collect(); + System.Threading.Thread.Sleep(1); + (window as SvgWindow).Resize(this.Width, this.Height); renderAndInvalidate(); |