I have found 2 issues with GraphicsEx.DrawLine
- It uses MoveToEx. This is not implemented in PocketPC 2002 but can be replaced by PolyLine.
- At the end it calls DeleteObject which effectively deletes the pen contained in the PenEx object, so if you use the object again, you'll get a black line.
Here is my replacement implementation:
public void DrawLine(PenEx pen, int xStart, int yStart, int xEnd, int yEnd)
{
//hme: modified to get rid of movetoex
IntPtr hOldPen = IntPtr.Zero;
hOldPen = GDIPlus.SelectObject(hDC, pen.hPen);
int[] Coords = {xStart,yStart,xEnd,yEnd};
GDIPlus.Polyline(hDC, Coords,2);
//Clean up
GDIPlus.SelectObject(hDC, hOldPen);
}
Cheers
Hans