Ultima.Map.GetImage C# (CSharp) Method

GetImage() public method

Returns Bitmap with Statics
public GetImage ( int x, int y, int width, int height ) : Bitmap
x int 8x8 Block
y int 8x8 Block
width int 8x8 Block
height int 8x8 Block
return System.Drawing.Bitmap
        public Bitmap GetImage(int x, int y, int width, int height)
        {
            return GetImage(x, y, width, height, true);
        }

Same methods

Map::GetImage ( int x, int y, int width, int height, bool statics ) : Bitmap
Map::GetImage ( int x, int y, int width, int height, Bitmap bmp ) : void
Map::GetImage ( int x, int y, int width, int height, Bitmap bmp, bool statics ) : void

Usage Example

Esempio n. 1
0
        private void OnPaint(object sender, PaintEventArgs e)
        {
            map = currmap.GetImage(hScrollBar.Value >> 3, vScrollBar.Value >> 3,
                                   (int)((e.ClipRectangle.Width / Zoom) + 8) >> 3, (int)((e.ClipRectangle.Height / Zoom) + 8) >> 3,
                                   showStaticsToolStripMenuItem1.Checked);
            ZoomMap(ref map);
            e.Graphics.DrawImageUnscaledAndClipped(map, e.ClipRectangle);

            if (showCenterCrossToolStripMenuItem1.Checked)
            {
                Brush brush = new SolidBrush(Color.FromArgb(180, Color.White));
                Pen   pen   = new Pen(brush);
                int   x     = Round((int)(pictureBox.Width / 2));
                int   y     = Round((int)(pictureBox.Height / 2));
                e.Graphics.DrawLine(pen, x - 4, y, x + 4, y);
                e.Graphics.DrawLine(pen, x, y - 4, x, y + 4);
                pen.Dispose();
                brush.Dispose();
            }

            if (showClientCrossToolStripMenuItem.Checked)
            {
                if (Client.Running)
                {
                    if ((ClientX > hScrollBar.Value) &&
                        (ClientX < hScrollBar.Value + e.ClipRectangle.Width / Zoom) &&
                        (ClientY > vScrollBar.Value) &&
                        (ClientY < vScrollBar.Value + e.ClipRectangle.Height / Zoom) &&
                        (ClientMap == currmapint))
                    {
                        Brush brush = new SolidBrush(Color.FromArgb(180, Color.Yellow));
                        Pen   pen   = new Pen(brush);
                        int   x     = (int)((ClientX - Round(hScrollBar.Value)) * Zoom);
                        int   y     = (int)((ClientY - Round(vScrollBar.Value)) * Zoom);
                        e.Graphics.DrawLine(pen, x - 4, y, x + 4, y);
                        e.Graphics.DrawLine(pen, x, y - 4, x, y + 4);
                        e.Graphics.DrawEllipse(pen, x - 2, y - 2, 2 * 2, 2 * 2);
                        pen.Dispose();
                        brush.Dispose();
                    }
                }
            }

            if (OverlayObjectTree.Nodes.Count > 0)
            {
                if (showMarkersToolStripMenuItem.Checked)
                {
                    foreach (TreeNode obj in OverlayObjectTree.Nodes[currmapint].Nodes)
                    {
                        OverlayObject o = (OverlayObject)obj.Tag;
                        if (o.isVisible(e.ClipRectangle, currmapint))
                        {
                            o.Draw(e.Graphics);
                        }
                    }
                }
            }
        }
All Usage Examples Of Ultima.Map::GetImage