12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- using System.Drawing;
- using System.Drawing.Drawing2D;
- namespace Microsoft.Drawing
- {
-
-
-
- public sealed class SmoothingModeGraphics : DisposableMini
- {
- private SmoothingMode m_OldMode;
- private Graphics m_Graphics;
-
-
-
-
- public SmoothingModeGraphics(Graphics graphics)
- : this(graphics, SmoothingMode.AntiAlias)
- {
- }
-
-
-
-
-
- public SmoothingModeGraphics(Graphics graphics, SmoothingMode newMode)
- {
- this.m_Graphics = graphics;
- this.m_OldMode = graphics.SmoothingMode;
- graphics.SmoothingMode = newMode;
- }
-
-
-
-
- protected override void Dispose(bool disposing)
- {
- if (this.m_Graphics != null)
- {
- this.m_Graphics.SmoothingMode = this.m_OldMode;
- this.m_Graphics = null;
- }
- this.m_OldMode = SmoothingMode.Default;
- }
- }
- }
|