21. November 2008

GDI+ am CompactFramework

von Daniel Siegl | Abgelegt in Compact Framework, Windows Mobile

EDIT: see also Silvermoon – englisch post.

Es gibt einen super Post von Alex Feinmann (Opennet.cf) für einen GDI+ Wrapper am CompactFramework.

Unterstützt wird dabei nur Windows Mobile Professional – darum wird vermutlich auch von MS nichts derartiges geliefert.

Leider unterstützt diese Implementierung keine Rechtecke mit abgerundeten Ecken. Dazu habe ich aber etwas auf CodeProject von Arun Reginald gefunden.

Dann habe ich 3 kleine Methoden in die GraphicsPlus Klasse von Alex integriert – und angepasst und schon kann ich abegerundete Rechtecke am Windows Mobile zeichnen.

public GraphicsPath GetRoundedRectanglePath(float x, float y, float width, float height, float radius)
{
     GpRectF rectangle = new GpRectF(x, y, width, height);
     return GetRoundedRect(rectangle, radius);
} 


public
void DrawRoundRectangle(PenPlus pen,float x, float y,float width, float height, float radius)
{
   
GraphicsPath path = GetRoundedRectanglePath(x, y, width, height, radius);
   
DrawPath(pen, path);
}
Share and Enjoy:
  • Technorati
  • Digg
  • Facebook
  • del.icio.us
  • Live
  • Google
  • description
  • description
  • TwitThis
Dieser Text wird durch den Flashinhalt ersetzt.

3 Kommentare zu “GDI+ am CompactFramework”

  1. Elegantere Controls für Windows Mobile 5 und 6 | LieberLieber Software TeamBlog:

    [...] allen Pocket Pc’s mit Windows Mobile 5 und 6 gibt es GDI+ wie schon in einem anderen Post von mir erwähnt. Die Standard Controls im Compact Framework sind ja eher Grau in Grau – Abhilfe [...]

  2. Silvermoon – Windows Mobile Controls | LieberLieber Software TeamBlog:

    [...] Just found the Silvermoon project on Codeplex after Frank pointed me there in Facebook. AWESOME!!!  I always like fancy Control that I don’t have to handcraft like in the GDI+ Article. [...]

  3. Dr.Luiji:

    Great info and good resources, thanks!
    Dr.Luiji

Kommentar hinzufügen