Sunday, July 03, 2005

By Pen You Mean Color

The Pen object in .NET CF 1.0 is incredibly limited. It has no methods and only one property, which is Color. So basically the Pen object is a glorified Color object. The .NET CF 2.0 fixes this a bit by including the Width attribute.

I found this in the MSDN .NET CF 1.0 FAQ:

Setting the pen width is not available in the .NET Compact Framework. Some alternate solutions include:

  • Drawing filled rectangles with the Graphics.FillRectangle method
  • Drawing multiple lines next to each other
  • Writing a custom graphics routine with GAPI

No comments: