BrightIdeasSoftware.Sprite.ApplyState(System.Drawing.Graphics)

Here are the examples of the csharp api class BrightIdeasSoftware.Sprite.ApplyState(System.Drawing.Graphics) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

3 Examples 7

1. Example

Project: MapViewer
Source File: ShapeSprite.cs
public override void Draw(Graphics g) {
            this.ApplyState(g);

            // We don't draw the shape into Bounds, since the location of the
            // shape is handled by a co-ordinate transformation. So we draw the
            // shape as if it was at origin 0,0
            this.DrawShape(g, new Rectangle(Point.Empty, this.Size), this.Opacity);
            this.UnapplyState(g);
        }

2. Example

Project: MapViewer
Source File: ImageSprite.cs
public override void Draw(Graphics g) {
            this.ApplyState(g);
            lock (this.locker) {
                if (this.Image != null) {
                    if (this.isAnimatedImage)
                        ImageAnimator.UpdateFrames(this.Image);

                    this.DrawTransparentBitmap(g, this.Bounds, this.Image, this.Opacity);
                }
                this.UnapplyState(g);
            }
        }

3. Example

Project: MapViewer
Source File: TextSprite.cs
public override void Draw(Graphics g) {
            if (String.IsNullOrEmpty(this.Text) || this.Opacity <= 0.0f)
                return;

            this.ApplyState(g);
            this.DrawText(g, this.Text, this.Opacity);
            this.UnapplyState(g);
        }