public void restoreGraphics(NetGraphics netG)
{
if (netG == null)
{
return;
}
if (netG.g != null)
{
if (savedGraphics)
{
netG.g.Transform = Transform;
netG.g.Clip = Clip;
netG.g.SmoothingMode = SmoothingMode;
netG.g.PixelOffsetMode = PixelOffsetMode;
netG.g.TextRenderingHint = TextRenderingHint;
netG.g.InterpolationMode = InterpolationMode;
netG.g.CompositingMode = CompositingMode;
}
else
{
// default values that Java used
netG.g.InterpolationMode = InterpolationMode.NearestNeighbor;
}
}
if ( pen != null && brush != null )
{
netG.pen = (Pen)pen.Clone();
netG.brush = (Brush)brush.Clone();
}
else
{
netG.pen = new Pen(netG.color);
netG.brush = new SolidBrush(netG.color);
}
}