In my bot right now, I'm working on my map display of the waypoints(and soon players/npcs...etc). It's just using primitive graphics from System.Drawing with circles around each waypoint, connecting consecutive waypoints with a green line. I had some very elaborate code, but it wasn't working the way I liked it. It had the center of a picturebox as the origin of WoW(x,y-wise). My waypoints were tiny and couldn't tell one from the other. I need some help rewriting this. Not sure how to do it =/
Here's my old code anyways...
Just a small hint would be nice, I couldn't find anything on google. Hard to google something like this o.OCode:Graphics g = Graphics.FromImage(bm); float XLow, YLow, XHigh, YHigh; XLow = 0; YLow = 0; XHigh = 0; YHigh = 0; int index = 0; XLow = m_parent.wm.waypoints[0].X; YLow = m_parent.wm.waypoints[0].Y; foreach (Location loc in m_parent.wm.waypoints) { if (XLow > loc.X) XLow = loc.X; if (YLow > loc.Y) YLow = loc.Y; if (YHigh < loc.Y) YHigh = loc.Y; if (XHigh < loc.X) XHigh = loc.X; } List<Point> offsets = new List<Point>(); foreach (Location loc in m_parent.wm.waypoints) { offsets.Add(new Point(Convert.ToInt32(loc.X - XLow), Convert.ToInt32(loc.Y - YLow))); } float scaleX = XHigh - XLow; if (scaleX < 0) scaleX = scaleX * (-1); float scaleY = YHigh - YLow; if (scaleY < 0) scaleY = scaleY * (-1); scaleX = (pictureBox1.Width / 2) / scaleX; scaleY = (pictureBox1.Height / 2) / scaleY; foreach (Point p in offsets) { float newX = p.X * scaleX; float newY = p.Y * scaleY; newX = (pictureBox1.Width / 2) + newX; newY = (pictureBox1.Height / 2) + newY; wps.Add(new Point(Convert.ToInt32(newX), Convert.ToInt32(newY))); } foreach (Point pt in wps) { bm.SetPixel(pt.X, pt.Y, Color.Red); g.DrawEllipse(new Pen(Brushes.Blue, 1), new Rectangle(pt.X - 5, pt.Y - 5, 10, 10)); } while ((index + 1) <= (m_parent.wm.waypoints.Count - 1)) { g.DrawLine(new Pen(Brushes.Green, 1f), wps[index], wps[index + 1]); index++; }