OSDN Git Service

パスを使用した描写も行うようにした
[d2dbench/d2dbench.git] / D2DBench / Direct2D.cs
index e1bcf8b..875a421 100644 (file)
@@ -107,6 +107,27 @@ namespace D2DBench
             render.DrawTextLayout(new Point(x,y), layout, colors[colorno]);
         }
 
+        public void DrawEllipseByBrush(int x, int y, int radiusX, int radiusY, int colorno, int backcolorno)
+        {
+            D2D.Ellipse ellipse = new Ellipse();
+            ellipse.Point = new PointF(x, y);
+            ellipse.RadiusX = radiusX;
+            ellipse.RadiusY = radiusY;
+            render.FillEllipse(ellipse, colors[backcolorno]);
+            render.DrawEllipse(ellipse, colors[colorno]);
+        }
+
+        public void DrawRectangleByBrush(int left, int top, int right, int bottom, int colorno, int backcolorno)
+        {
+            SharpDX.RectangleF rect = new SharpDX.RectangleF();
+            rect.Left = left;
+            rect.Top = top;
+            rect.Right = right;
+            rect.Bottom = bottom;
+            render.FillRectangle(rect, colors[backcolorno]);
+            render.DrawRectangle(rect, colors[colorno]);
+        }
+
         public void DrawEllipse(int x, int y, int radiusX, int radiusY, int colorno)
         {
             var fore = colors[colorno];