GDI+ missing functionality in PocketPC
-
Sorry if this is a common problem that people already know the answer to, but... I've written a cool app for use in aircraft navigation, and it draws a compass rose by drawing to a graphics path and then using a matrix to rotate it. Except this functionality is missing in the PocketPC GDI+ library. Apart from the obvious (write my own anti-aliased rotation code) is there anything I can do to get this to work on a PocketPC? TIA. for (int i = 0; i < 360; i+=10) { GraphicsPath gpRose = new GraphicsPath(); gpRose.AddLine(centre.X, centre.Y - radius - 3, centre.X, centre.Y - radius - 13); if (i%30 == 0) { gpRose.AddString(i.ToString("000"), new FontFamily("Arial"), (int)FontStyle.Regular, 10, new PointF(centre.X - hdgWidth/2, centre.Y - radius - 25), null); } Matrix roseMatrix = new Matrix(); roseMatrix.RotateAt((float)(i-iActualHeading), new PointF(centre.X, centre.Y)); gpRose.Transform(roseMatrix); e.Graphics.DrawPath(p, gpRose); }
-
Sorry if this is a common problem that people already know the answer to, but... I've written a cool app for use in aircraft navigation, and it draws a compass rose by drawing to a graphics path and then using a matrix to rotate it. Except this functionality is missing in the PocketPC GDI+ library. Apart from the obvious (write my own anti-aliased rotation code) is there anything I can do to get this to work on a PocketPC? TIA. for (int i = 0; i < 360; i+=10) { GraphicsPath gpRose = new GraphicsPath(); gpRose.AddLine(centre.X, centre.Y - radius - 3, centre.X, centre.Y - radius - 13); if (i%30 == 0) { gpRose.AddString(i.ToString("000"), new FontFamily("Arial"), (int)FontStyle.Regular, 10, new PointF(centre.X - hdgWidth/2, centre.Y - radius - 25), null); } Matrix roseMatrix = new Matrix(); roseMatrix.RotateAt((float)(i-iActualHeading), new PointF(centre.X, centre.Y)); gpRose.Transform(roseMatrix); e.Graphics.DrawPath(p, gpRose); }
While the
GraphicsPath
andMatrix
classes aren't supported in the Compact Framework, theGraphics
class is. It won't be easy since you'll have to do a lot of calculates instead of harnessing the power of theMatrix
(and I thought the "Matrix" was a bad thing! :)), but you could perform all the drawing using the methods of theGraphics
class.-----BEGIN GEEK CODE BLOCK----- Version: 3.21 GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++ -----END GEEK CODE BLOCK-----
-
While the
GraphicsPath
andMatrix
classes aren't supported in the Compact Framework, theGraphics
class is. It won't be easy since you'll have to do a lot of calculates instead of harnessing the power of theMatrix
(and I thought the "Matrix" was a bad thing! :)), but you could perform all the drawing using the methods of theGraphics
class.-----BEGIN GEEK CODE BLOCK----- Version: 3.21 GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++ -----END GEEK CODE BLOCK-----
I tried to port a custom control earlier today, and althought the Graphics class is availble, its severly limited. I did notice a GAPI .NET wrapper on pocketpcdn.com[^] leppie::AllocCPArticle("Zee blog");
Seen on my Campus BBS: Linux is free...coz no-one wants to pay for it.