Summary
Provides a way to temporarily modify the Transform of a System.Drawing.Graphics object by enclosing the affected code in a “using” scope.
Example
The following example demonstrates how GraphicsTransformer can be used to render graphics translated.
var g = Graphics.FromImage(...);
using (new GraphicsTransformer(g).Translate(15, 10))
{
// As this is inside the scope of the GraphicsTransformer, the rectangle is translated 15 pixels to the right and 10 down.
g.DrawRectangle(20, 20, 100, 100);
}
// As this statement is outside the scope of the GraphicsTransformer, the rectangle is not translated.
// The net effect is that two rectangles are rendered even though both calls use the same co-ordinates.
g.DrawRectangle(20, 20, 100, 100);
Constructors
Instance methods