Here are the examples of the csharp api class System.Drawing.Graphics.Dispose() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
200 Examples
0
1. Example
Project: Krypton
Source File: ViewContext.cs
Source File: ViewContext.cs
public void Dispose() { // Is there a graphics instance that might need disposed? if (_graphics != null) { // Only dispose if we created it if (_disposeGraphics) _graphics.Dispose(); _graphics = null; } // Is there a manager instance that might need disposed? if (_manager != null) { // Only dispose if we created it if (_disposeManager) _manager.Dispose(); _manager = null; } }
0
2. Example
Project: xsddiagram
Source File: MainForm.cs
Source File: MainForm.cs
private void UpdateDiagram() { if (this.diagram.RootElements.Count != 0) { Graphics g = this.panelDiagram.DiagramControl.CreateGraphics(); this.diagram.Layout(g); g.Dispose(); Size bbSize = this.diagram.BoundingBox.Size + this.diagram.Padding + this.diagram.Padding; this.panelDiagram.VirtualSize = new Size((int)(bbSize.Width * this.diagram.Scale), (int)(bbSize.Height * this.diagram.Scale)); } else this.panelDiagram.VirtualSize = new Size(0, 0); }
0
3. Example
Project: arcobjects-sdk-community-samples
Source File: SpatialQuery.cs
Source File: SpatialQuery.cs
private void UpdateValueDisplay() { Graphics graphics = this.CreateGraphics(); dataGridView/n ..... /n //View Source file for more details /n }
0
4. Example
Project: cassette
Source File: SpriteWriter.cs
Source File: SpriteWriter.cs
public void Dispose() { if (drawingSurface != null) drawingSurface.Dispose(); }
0
5. Example
Project: just-gestures
Source File: UC_TP_baseActivator.cs
Source File: UC_TP_baseActivator.cs
public virtual void Display_MouseClick(object sender, MouseEventArgs e) { if (m_tempGesture.Activator != null) { if (m_gp != null) m_gp.Dispose(); m_tempGesture.Activator.AnimateToPictureBox(m_pbDisplay); } }
0
6. Example
Project: MultiversePlatform
Source File: LayeredComplexText.cs
Source File: LayeredComplexText.cs
protected void ReleaseGraphics(Graphics g) { if (dynamic) { g.Dispose(); chunkAtlas.texture.ReleaseGraphics(); } }
0
7. Example
Project: RequestReduce
Source File: SpriteWriter.cs
Source File: SpriteWriter.cs
public void Dispose() { if (drawingSurface != null) drawingSurface.Dispose(); }
0
8. Example
Project: ATF
Source File: D2dGraphics.cs
Source File: D2dGraphics.cs
public void EndGdiSection() { if (m_graphics == null) throw new InvalidOperationException("BeginGDISection() call required"); m_graphics.Dispose(); m_graphics = null; m_gdiInterop.ReleaseDC(); }
0
9. Example
Project: GestureSign
Source File: DiBitmap.cs
Source File: DiBitmap.cs
public void Dispose() { if (_graphics != null) { _graphics.Dispose(); _graphics = null; } NativeMethods.SelectObject(_memDc, _oldObject); NativeMethods.DeleteDC(_memDc); if (HBitmap != IntPtr.Zero) { NativeMethods.DeleteObject(HBitmap); HBitmap = IntPtr.Zero; } }
0
10. Example
Project: SQLMonitor
Source File: TreeBuilder.cs
Source File: TreeBuilder.cs
public void Dispose() { _tree = null; if (_gr != null) { _gr.Dispose(); _gr = null; } }
0
11. Example
Project: PersianBingCalendar
Source File: PersianCalendarRenderer.cs
Source File: PersianCalendarRenderer.cs
protected virtual void Dispose(bool disposeManagedResources) { if (_disposed) return; if (!disposeManagedResources) return; _graphics?.Dispose(); _disposed = true; }
0
12. Example
Project: WGestures
Source File: DiBitmap.cs
Source File: DiBitmap.cs
public void Dispose() { if (_graphics != null) { _graphics.Dispose(); _graphics = null; } Native.SelectObject(_memDc, _oldObject); Native.DeleteDC(_memDc); if (HBitmap != IntPtr.Zero) { Native.DeleteObject(HBitmap); HBitmap = IntPtr.Zero; } }
0
13. Example
Project: ContinuousTests
Source File: DefaultErrorListRenderer.cs
Source File: DefaultErrorListRenderer.cs
public void Dispose() { if (_workingImage != null) { _workingImage.Dispose(); WorkingGraphics.Dispose(); } return; }
0
14. Example
Project: ContinuousTests
Source File: DefaultErrorListRenderer.cs
Source File: DefaultErrorListRenderer.cs
public void Dispose() { if (_workingImage != null) { _workingImage.Dispose(); WorkingGraphics.Dispose(); } return; }
0
15. Example
Project: ContinuousTests
Source File: DefaultErrorListRenderer.cs
Source File: DefaultErrorListRenderer.cs
public void Dispose() { if (_workingImage != null) { _workingImage.Dispose(); WorkingGraphics.Dispose(); } return; }
0
16. Example
Project: nextra
Source File: DataGridViewExtensionsBehvaior.cs
Source File: DataGridViewExtensionsBehvaior.cs
[TearDown] public void TearDown() { _dgv.Dispose(); _graphics.Dispose(); _imageList.Dispose(); _paintingEventArgs = null; }
0
17. Example
Project: EDDiscovery
Source File: TabControlCustom.cs
Source File: TabControlCustom.cs
private void CleanUp() { if (backImageControlBitmap != null) { backImageControlBitmap.Dispose(); backImageControlBitmap = null; } if (backImageBitmap != null) { backImageBitmap.Dispose(); backImageBitmap = null; } if (backImageGraphics != null) { backImageGraphics.Dispose(); backImageGraphics = null; } if (tabImageBitmap != null) { tabImageBitmap.Dispose(); tabImageBitmap = null; } if (tabImageGraphics != null) { tabImageGraphics.Dispose(); tabImageGraphics = null; } }
0
18. Example
Project: tesvsnip
Source File: virtuallistview.cs
Source File: virtuallistview.cs
private void DisposeInternal() { if (internalGraphics != null) internalGraphics.Dispose(); if (internalBitmap != null) internalBitmap.Dispose(); }
0
19. Example
Project: falloutsnip
Source File: virtuallistview.cs
Source File: virtuallistview.cs
private void DisposeInternal() { if (internalGraphics != null) internalGraphics.Dispose(); if (internalBitmap != null) internalBitmap.Dispose(); }
0
20. Example
Project: Afterglow
Source File: CopyScreenCapture.cs
Source File: CopyScreenCapture.cs
public override void Stop() { _running = false; if (_img != null) { _img.Dispose(); _img = null; } if (_graphics != null) { _graphics.Dispose(); _graphics = null; } }
0
21. Example
Project: MGE-XE
Source File: MainForm.cs
Source File: MainForm.cs
protected override void OnPaint (System.Windows.Forms.PaintEventArgs e) { Graphics graphics = e.Graphics; Icon ic = new Icon (Properties.Resources.AppIcon, 96, 96); graphics.DrawIcon (ic, 12, 24); graphics.Dispose (); }
0
22. Example
Project: gitter
Source File: FlowLayoutControl.cs
Source File: FlowLayoutControl.cs
protected override void UpdateHover(int x, int y) { if(_mouseDownPanel != null && _mouseDownPanel.FlowControl == this) { int panelY = ClientArea.Y - VScrollPos; for(int i = 0; i < _panels.Count; ++i) { var panel = _panels[i]; var size = GetPanelSize(panel); int maxY = panelY + size.Height; if(panel == _mouseDownPanel) { _panelHover.Track(i, panel); panel.MouseMove(x - ClientArea.X + HScrollPos, y - panelY); break; } panelY = maxY; } } else { if(x >= ClientArea.X && x < ClientArea.Right) { bool hover = false; Graphics graphics = null; int panelY = ClientArea.Y - VScrollPos; for(int i = 0; i < _panels.Count; ++i) { var panel = _panels[i]; var size = GetPanelSize(panel); int maxY = panelY + size.Height; if(maxY >= y) { hover = true; _panelHover.Track(i, panel); panel.MouseMove(x - ClientArea.X + HScrollPos, y - panelY); break; } if(maxY >= ClientRectangle.Bottom) { break; } panelY = maxY; } if(!hover) { _panelHover.Drop(); } if(graphics != null) { graphics.Dispose(); } } else { _panelHover.Drop(); } } base.UpdateHover(x, y); }
0
23. Example
Project: gitter
Source File: TextBoxSpellChecker.cs
Source File: TextBoxSpellChecker.cs
private void OnSizeChanged(object sender, EventArgs e) { if(_textBoxGraphics != null) { _textBoxGraphics.Dispose(); } _textBoxGraphics = Graphics.FromHwnd(_textBox.Handle); }
0
24. Example
Project: Mario-Game
Source File: Form1.cs
Source File: Form1.cs
private void MainForm_Paint(object sender, PaintEventArgs e) { Graphics xGraph = e.Graphics; xGraph.DrawImage(MainImage, 0, 0); xGraph.Dispose(); }
0
25. Example
Project: ElectronicObserver
Source File: DialogHalloween.cs
Source File: DialogHalloween.cs
private void DialogHalloween_FormClosed(object sender, FormClosedEventArgs e) { Updater.Stop(); paintbrush.Dispose(); canvas.Dispose(); for (int i = 0; i < fairies.Length; i++) if (fairies[i] != null) fairies[i].Dispose(); }
0
26. Example
Project: WzComparerR2
Source File: Gif.cs
Source File: Gif.cs
private Bitmap GetFrame(int i, Rectangle canvasRect) { var iFrame = this.Frames[i]; Bitmap bmp = new Bitmap(canvasRect.Width, canvasRect.Height, PixelFormat.Format32bppArgb); Graphics g = Graphics.FromImage(bmp); iFrame.Draw(g, canvasRect); g.Dispose(); return bmp; }
0
27. Example
Project: My-FyiReporting
Source File: RenderHtmlTable.cs
Source File: RenderHtmlTable.cs
public void Dispose() { // These should already be cleaned up; but in case of an unexpected error // these still need to be disposed of if (_bm != null) _bm.Dispose(); if (_g != null) _g.Dispose(); }
0
28. Example
Project: My-FyiReporting
Source File: RenderExcel.cs
Source File: RenderExcel.cs
public void Dispose() { // These should already be cleaned up; but in case of an unexpected error // these still need to be disposed of if (_bm != null) _bm.Dispose(); if (_g != null) _g.Dispose(); }
0
29. Example
Project: My-FyiReporting
Source File: RenderExcel.cs
Source File: RenderExcel.cs
public virtual void End() { Stream fs = _sg.GetStream(); _Excel.WriteExcel(fs); if (_g != null) { _g.Dispose(); _g = null; } if (_bm != null) { _bm.Dispose(); _bm = null; } return; }
0
30. Example
Project: My-FyiReporting
Source File: RenderHtml.cs
Source File: RenderHtml.cs
public void Dispose() { // These should already be cleaned up; but in case of an unexpected error // these still need to be disposed of if (_bm != null) _bm.Dispose(); if (_g != null) _g.Dispose(); }
0
31. Example
Project: My-FyiReporting
Source File: RenderRtf.cs
Source File: RenderRtf.cs
public void Dispose() { // These should already be cleaned up; but in case of an unexpected error // these still need to be disposed of if (_bm != null) _bm.Dispose(); if (_g != null) _g.Dispose(); }
0
32. Example
Project: My-FyiReporting
Source File: Pages.cs
Source File: Pages.cs
public void CleanUp() { if (_g != null) { _g.Dispose(); _g = null; } if (_bm != null) { _bm.Dispose(); _bm = null; } }
0
33. Example
Project: just-gestures
Source File: Form_addGesture.cs
Source File: Form_addGesture.cs
private void panel_ForButtons_Paint(object sender, PaintEventArgs e) { Graphics g = panel_ForButtons.CreateGraphics(); g.DrawLine(new Pen(Brushes.Gray, 1), 0, 2, panel_ForButtons.Width, 2); //g.DrawLine(new Pen(Brushes.Black, 1), 0, 2, panel_ForButtons.Width, 2); g.DrawLine(new Pen(Brushes.White, 1), 0, 1, panel_ForButtons.Width, 1); g.Dispose(); }
0
34. Example
Project: just-gestures
Source File: Form_modifyGesture.cs
Source File: Form_modifyGesture.cs
private void panel_down_Paint(object sender, PaintEventArgs e) { Graphics g = panel_down.CreateGraphics(); g.DrawLine(new Pen(Brushes.Gray, 1), 0, 2, panel_down.Width, 2); g.DrawLine(new Pen(Brushes.White, 1), 0, 1, panel_down.Width, 1); g.Dispose(); }
0
35. Example
Project: just-gestures
Source File: Form_options.cs
Source File: Form_options.cs
private void panel_down_Paint(object sender, PaintEventArgs e) { Graphics g = panel_down.CreateGraphics(); g.DrawLine(new Pen(Brushes.Gray, 1), 0, 2, panel_down.Width, 2); g.DrawLine(new Pen(Brushes.White, 1), 0, 1, panel_down.Width, 1); g.Dispose(); }
0
36. Example
Project: just-gestures
Source File: Form_wizard.cs
Source File: Form_wizard.cs
private void panel_ForButtons_Paint(object sender, PaintEventArgs e) { Graphics g = panel_ForButtons.CreateGraphics(); g.DrawLine(new Pen(Brushes.Gray, 1), 0, 2, panel_ForButtons.Width, 2); //g.DrawLine(new Pen(Brushes.Black, 1), 0, 2, panel_ForButtons.Width, 2); g.DrawLine(new Pen(Brushes.White, 1), 0, 1, panel_ForButtons.Width, 1); g.Dispose(); }
0
37. Example
Project: just-gestures
Source File: Form_gestures.cs
Source File: Form_gestures.cs
private void pB_display_MouseUp(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Left && m_pathPoints.Count > 1) { m_gp.Dispose(); m_mouseDown = false; RedrawAll(); } }
0
38. Example
Project: MultiversePlatform
Source File: LayeredComplexText.cs
Source File: LayeredComplexText.cs
protected void DisposeBitmap() { if (staticGraphics != null) { staticGraphics.Dispose(); staticGraphics = null; } // dispose of the bitmap if (bitmap != null) { bitmap.Dispose(); bitmap = null; } }
0
39. Example
Project: HTML-Renderer
Source File: GraphicsAdapter.cs
Source File: GraphicsAdapter.cs
public override void Dispose() { ReleaseHdc(); if (_releaseGraphics) _g.Dispose(); if (_useGdiPlusTextRendering && _setRtl) _stringFormat2.FormatFlags ^= StringFormatFlags.DirectionRightToLeft; }
0
40. Example
Project: oxyplot
Source File: SvgExporter.cs
Source File: SvgExporter.cs
public void Dispose() { this.g.Dispose(); this.grc.Dispose(); }
0
41. Example
Project: partcover.net4
Source File: TextControl.cs
Source File: TextControl.cs
protected override void Dispose(bool disposing) { base.Dispose(disposing); if (disposing) { if (null != graphics) { graphics.Dispose(); graphics = null; } view = null; } }
0
42. Example
Project: GEDKeeper
Source File: GdiRenderer.cs
Source File: GdiRenderer.cs
public void Dispose() { if (fCurrentFont != null) fCurrentFont.Dispose(); fGraphics.Dispose(); }
0
43. Example
Project: SharpMap
Source File: Utf8Grid.cs
Source File: Utf8Grid.cs
public void Dispose() { if (this.bitmap != null) { this.bitmap.Dispose(); this.bitmap = null; } if (this.graphics != null) { this.graphics.Dispose(); this.graphics = null; } }
0
44. Example
Project: Gorgon
Source File: Spray.cs
Source File: Spray.cs
private void Dispose(bool disposing) { if (_disposed) { return; } if (disposing) { if (Surface != null) { Surface.Dispose(); Surface = null; } if (_graphics != null) { _graphics.Dispose(); _graphics = null; } } _disposed = true; }
0
45. Example
Project: Gorgon
Source File: FormCharacterPicker.cs
Source File: FormCharacterPicker.cs
protected override void OnFormClosing(FormClosingEventArgs e) { base.OnFormClosing(e); DeselectFont(); if (_graphics != null) { _graphics.Dispose(); } }
0
46. Example
Project: xenadmin
Source File: GridView.cs
Source File: GridView.cs
private void DisposeBuffer() { BackBuffer.Dispose(); BufferGraphics.Dispose(); Graphics.Dispose(); }
0
47. Example
Project: xenadmin
Source File: DoubleBufferedPanel.cs
Source File: DoubleBufferedPanel.cs
private void DisposeBuffer() { if (BufferGraphics != null) { BufferGraphics.Dispose(); BufferGraphics = null; } if (BackBuffer != null) { BackBuffer.Dispose(); BackBuffer = null; } }
0
48. Example
Project: Cropper
Source File: PaintLayerEventArgs.cs
Source File: PaintLayerEventArgs.cs
public void Dispose() { if (Graphics != null) Graphics.Dispose(); if (Image != null) Image.Dispose(); }
0
49. Example
Project: AutoTest.Net
Source File: DefaultErrorListRenderer.cs
Source File: DefaultErrorListRenderer.cs
public void Dispose() { if (_workingImage != null) { _workingImage.Dispose(); WorkingGraphics.Dispose(); } return; }
0
50. Example
Project: AutoTest.Net
Source File: DefaultErrorListRenderer.cs
Source File: DefaultErrorListRenderer.cs
public void Dispose() { if (_workingImage != null) { _workingImage.Dispose(); WorkingGraphics.Dispose(); } return; }