CCT.NUI.Samples.ImageManipulation.InteractiveImage.Draw C# (CSharp) Method

Draw() public method

public Draw ( Graphics g ) : void
g System.Drawing.Graphics
return void
        public void Draw(Graphics g)
        {
            var deltaX = position.X + size.Width / 2;
            var deltaY = position.Y + size.Height / 2;
            g.TranslateTransform(deltaX, deltaY);
            g.RotateTransform(this.transformation.Angle);
            g.TranslateTransform(-deltaX, -deltaY);
            g.DrawImage(this.bitmap, position.X, position.Y, this.size.Width, this.size.Height);
            if (this.Hovered)
            {
                g.DrawRectangle(borderPen, position.X, position.Y, this.size.Width, this.size.Height);
            }
            if (this.Selected)
            {
                g.DrawRectangle(Pens.Orange, position.X, position.Y, this.size.Width, this.size.Height);
            }
            g.ResetTransform();
        }