12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- using System.Drawing;
- using System.Drawing.Text;
- namespace Microsoft.Drawing
- {
-
-
-
- public sealed class TextRenderingHintGraphics : DisposableMini
- {
- private TextRenderingHint m_OldHint;
- private Graphics m_Graphics;
-
-
-
-
- public TextRenderingHintGraphics(Graphics graphics)
- : this(graphics, TextRenderingHint.AntiAlias)
- {
- }
-
-
-
-
-
- public TextRenderingHintGraphics(Graphics graphics, TextRenderingHint newHint)
- {
- this.m_Graphics = graphics;
- this.m_OldHint = graphics.TextRenderingHint;
- graphics.TextRenderingHint = newHint;
- }
-
-
-
-
- protected override void Dispose(bool disposing)
- {
- if (this.m_Graphics != null)
- {
- this.m_Graphics.TextRenderingHint = this.m_OldHint;
- this.m_Graphics = null;
- }
- this.m_OldHint = TextRenderingHint.SystemDefault;
- }
- }
- }
|