ikvm.awt.NetGraphicsState.restoreGraphics C# (CSharp) Method

restoreGraphics() public method

public restoreGraphics ( NetGraphics netG ) : void
netG NetGraphics
return void
        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);
            }
        }

Usage Example

Exemplo n.º 1
0
 protected void init(Graphics graphics)
 {
     NetGraphicsState state = new NetGraphicsState();
     state.saveGraphics(this);
     g = graphics;
     state.restoreGraphics(this);            
 }
All Usage Examples Of ikvm.awt.NetGraphicsState::restoreGraphics