123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- using System.Drawing;
- namespace Microsoft.Drawing
- {
-
-
-
- public sealed class TranslateGraphics : DisposableMini
- {
- private int m_X;
- private int m_Y;
- private Graphics m_Graphics;
-
-
-
-
-
-
- public TranslateGraphics(Graphics graphics, int x, int y)
- {
- this.m_Graphics = graphics;
- this.m_X = x;
- this.m_Y = y;
- this.m_Graphics.TranslateTransform(this.m_X, this.m_Y);
- }
-
-
-
-
-
- public TranslateGraphics(Graphics graphics, Point p)
- {
- this.m_Graphics = graphics;
- this.m_X = p.X;
- this.m_Y = p.Y;
- this.m_Graphics.TranslateTransform(this.m_X, this.m_Y);
- }
-
-
-
-
-
- public TranslateGraphics(Graphics graphics, Size s)
- {
- this.m_Graphics = graphics;
- this.m_X = s.Width;
- this.m_Y = s.Height;
- this.m_Graphics.TranslateTransform(this.m_X, this.m_Y);
- }
-
-
-
-
- protected override void Dispose(bool disposing)
- {
- if (this.m_Graphics != null)
- {
- this.m_Graphics.TranslateTransform(-this.m_X, -this.m_Y);
- this.m_Graphics = null;
- }
- this.m_X = 0;
- this.m_Y = 0;
- }
- }
- }
|