Exemplo n.º 1
0
 public override void DrawRect(LGuiRect Rect, LGuiColor Color, bool IsFill, bool IsRound)
 {
     if (IsRound)
     {
         if (IsFill)
         {
             Device_.FillPath(BrushCache.GetOrCreate(Color),
                              GenerateRectPath((int)Rect.X, (int)Rect.Y, (int)Rect.Width, (int)Rect.Height, 10, 10));
         }
         else
         {
             Device_.DrawPath(PenCache.GetOrCreate(Color),
                              GenerateRectPath((int)Rect.X, (int)Rect.Y, (int)Rect.Width, (int)Rect.Height, 10, 10));
         }
     }
     else
     {
         if (IsFill)
         {
             Device_.FillRectangle(BrushCache.GetOrCreate(Color),
                                   new Rectangle((int)Rect.X, (int)Rect.Y, (int)Rect.Width, (int)Rect.Height));
         }
         else
         {
             Device_.DrawRectangle(PenCache.GetOrCreate(Color),
                                   new Rectangle((int)Rect.X, (int)Rect.Y, (int)Rect.Width, (int)Rect.Height));
         }
     }
 }
Exemplo n.º 2
0
 public override void DrawTriangle(LGuiVec2 Vert1, LGuiVec2 Vert2, LGuiVec2 Vert3, LGuiColor Color, bool IsFill)
 {
     if (IsFill)
     {
         Device_.FillPath(BrushCache.GetOrCreate(Color), GenerateTrianglePath((int)Vert1.X, (int)Vert1.Y, (int)Vert2.X, (int)Vert2.Y, (int)Vert3.X, (int)Vert3.Y));
     }
     else
     {
         Device_.DrawPath(PenCache.GetOrCreate(Color), GenerateTrianglePath((int)Vert1.X, (int)Vert1.Y, (int)Vert2.X, (int)Vert2.Y, (int)Vert3.X, (int)Vert3.Y));
     }
 }
Exemplo n.º 3
0
 public override void DrawCircle(LGuiVec2 Center, float Radius, LGuiColor Color, bool IsFill)
 {
     if (IsFill)
     {
         Device_.FillEllipse(BrushCache.GetOrCreate(Color),
                             new Rectangle((int)(Center.X - Radius), (int)(Center.Y - Radius), (int)(Radius * 2), (int)(Radius * 2)));
     }
     else
     {
         Device_.DrawEllipse(PenCache.GetOrCreate(Color),
                             new Rectangle((int)(Center.X - Radius), (int)(Center.Y - Radius), (int)(Radius * 2), (int)(Radius * 2)));
     }
 }
Exemplo n.º 4
0
 public override void DrawText(string Text, LGuiVec2 Pos, LGuiColor Color, LGuiFont Font)
 {
     Device_.DrawString(Text, FontCache.GetOrCreate(Font), BrushCache.GetOrCreate(Color), Pos.X, Pos.Y, FontStringFormat);
 }