/// <summary> /// Draws the rectangle on the provided Graphics /// </summary> /// <param name="g">The graphics on which the drawing happens</param> /// <param name="ViewInfo">Information about the current map view</param> public void Draw(Graphics g, MapViewInfo ViewInfo) { Point p = ViewInfo.MapToControl(m_Location); int x = p.X; int y = p.Y; Brush brush = new SolidBrush(m_Color); Pen pen = new Pen(brush); g.DrawLine(pen, x - m_Length, y, x + m_Length, y); g.DrawLine(pen, x, y - m_Length, x, y + m_Length); }
/// <summary> /// Draws the rectangle on the provided Graphics /// </summary> /// <param name="g">The graphics on which the drawing happens</param> /// <param name="ViewInfo">Information about the current map view</param> public void Draw(Graphics g, MapViewInfo ViewInfo) { Point p1 = ViewInfo.MapToControl(new Point(m_Location.X, m_Location.Y)); Point p2 = ViewInfo.MapToControl(new Point(m_Location.Right, m_Location.Bottom)); Brush borderBrush = new SolidBrush(m_Color); Pen borderPen = new Pen(borderBrush); g.DrawRectangle(borderPen, p1.X, p1.Y, p2.X - p1.X, p2.Y - p1.Y); if (m_Fill) { Brush fillBrush = new SolidBrush(m_FillColor); g.FillRectangle(fillBrush, p1.X, p1.Y, p2.X - p1.X, p2.Y - p1.Y); } }
public void Draw(Graphics g, MapViewInfo ViewInfo) { var c = ViewInfo.MapToControl(new Point(Spawn.X, Spawn.Y)); var x1 = c.X - 3; var x2 = c.X + 3; var y1 = c.Y - 3; var y2 = c.Y + 3; var color = Pandora.Profile.Travel.SpawnColor; var pen = new Pen(color); g.DrawLine(pen, x1, y1, x2, y2); g.DrawLine(pen, x1, y2, x2, y1); g.DrawLine(pen, c.X, y1, c.X, y2); g.DrawLine(pen, x1, c.Y, x2, c.Y); pen.Dispose(); }
/// <summary> /// Draws the circle /// </summary> /// <param name="g">The Graphics object used for the drawing</param> /// <param name="ViewInfo">Information about the current map view</param> public void Draw(Graphics g, MapViewInfo ViewInfo) { // Draw at specified location Point p = ViewInfo.MapToControl(m_Location); int x = p.X; int y = p.Y; Brush brush = new SolidBrush(m_Color); Pen pen = new Pen(brush); // Change radius accordingly to zoom level int radius = ViewInfo.MapToControl(m_Radius); // Draw the circle g.DrawEllipse(pen, x - radius, y - radius, radius * 2, radius * 2); if (m_Fill) { // Fill it brush = new SolidBrush(m_FillColor); g.FillEllipse(brush, x - radius, y - radius, radius * 2, radius * 2); } }
/// <summary> /// Draws the circle /// </summary> /// <param name="g">The Graphics object used for the drawing</param> /// <param name="ViewInfo">Information about the current map view</param> public void Draw(Graphics g, MapViewInfo ViewInfo ) { // Draw at specified location Point p = ViewInfo.MapToControl( m_Location ); int x = p.X; int y = p.Y; Brush brush = new SolidBrush( m_Color ); Pen pen = new Pen( brush ); // Change radius accordingly to zoom level int radius = ViewInfo.MapToControl( m_Radius ); // Draw the circle g.DrawEllipse( pen, x - radius , y - radius, radius * 2, radius * 2 ); if ( m_Fill ) { // Fill it brush = new SolidBrush( m_FillColor ); g.FillEllipse( brush, x - radius, y - radius, radius * 2, radius * 2 ); } }
/// <summary> /// Draws the rectangle on the provided Graphics /// </summary> /// <param name="g">The graphics on which the drawing happens</param> /// <param name="ViewInfo">Information about the current map view</param> public void Draw(Graphics g, MapViewInfo ViewInfo) { Point p = ViewInfo.MapToControl( m_Location ); int x = p.X; int y = p.Y; Brush brush = new SolidBrush( m_Color ); Pen pen = new Pen( brush ); g.DrawLine( pen, x - m_Length, y, x + m_Length, y ); g.DrawLine( pen, x, y - m_Length, x, y + m_Length ); }
/// <summary> /// Draws the rectangle on the provided Graphics /// </summary> /// <param name="g">The graphics on which the drawing happens</param> /// <param name="ViewInfo">Information about the current map view</param> public void Draw(Graphics g, MapViewInfo ViewInfo ) { Point p1 = ViewInfo.MapToControl( new Point( m_Location.X, m_Location.Y ) ); Point p2 = ViewInfo.MapToControl( new Point( m_Location.Right, m_Location.Bottom ) ); Brush borderBrush = new SolidBrush( m_Color ); Pen borderPen = new Pen( borderBrush ); g.DrawRectangle( borderPen, p1.X, p1.Y, p2.X - p1.X, p2.Y - p1.Y ); if ( m_Fill ) { Brush fillBrush = new SolidBrush( m_FillColor ); g.FillRectangle( fillBrush, p1.X, p1.Y, p2.X - p1.X, p2.Y - p1.Y ); } }