Direct2D Draw and Fill

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Direct2D Draw and Fill相关的知识,希望对你有一定的参考价值。

---恢复内容开始---

画线:

ID2D1RenderTarget::DrawLine

virtual void DrawLine(
                  D2D1_POINT_2F point0,//起点
                  D2D1_POINT_2F point1,//终点
  [in]            ID2D1Brush *brush,
                  FLOAT strokeWidth = 1.0f,//线条粗细
  [in, optional]  ID2D1StrokeStyle *strokeStyle = NULL//可省略
) = 0;

 

椭圆:

struct D2D1_ELLIPSE {
  D2D1_POINT_2F point;
  FLOAT         radiusX;
  FLOAT         radiusY;
};

矩形:

圆角矩形:

struct D2D1_ROUNDED_RECT {
  D2D1_RECT_F rect;
  FLOAT       radiusX;
  FLOAT       radiusY;
};

画轮廓:

ID2D1RenderTarget::DrawEllipse

void DrawEllipse(
  [ref]           const D2D1_ELLIPSE &ellipse,
  [in]            ID2D1Brush *brush,
                  FLOAT strokeWidth = 1.0f,
  [in, optional]  ID2D1StrokeStyle *strokeStyle = NULL
);

ID2D1RenderTarget::DrawRectangle

void DrawRectangle(
  [ref]           const D2D1_RECT_F &rect,
  [in]            ID2D1Brush *brush,
                  FLOAT strokeWidth = 1.0f,
  [in, optional]  ID2D1StrokeStyle *strokeStyle = NULL
);

ID2D1RenderTarget::DrawRoundedRectangle

 

void DrawRoundedRectangle(
  [ref]           const D2D1_ROUNDED_RECT &roundedRect,
  [in]            ID2D1Brush *brush,
                  FLOAT strokeWidth = 1.0f,
  [in, optional]  ID2D1StrokeStyle *strokeStyle = NULL
);

 

 

 

填充:

ID2D1RenderTarget::FillEllipse

void FillEllipse(
  [ref]  const D2D1_ELLIPSE &ellipse,
  [in]   ID2D1Brush *brush
);

ID2D1RenderTarget::FillRectangle 

 

void FillRectangle(
  [ref]  const D2D1_RECT_F &rect,
  [in]   ID2D1Brush *brush
);

 

ID2D1RenderTarget::FillRoundedRectangle 

void FillRoundedRectangle(
  [ref]  const D2D1_ROUNDED_RECT &roundedRect,
  [in]   ID2D1Brush *brush
);

 

 

 

---恢复内容结束---

以上是关于Direct2D Draw and Fill的主要内容,如果未能解决你的问题,请参考以下文章

[python][原创]PIL中polygon参数outline和fill理解

如何在android画布中绘制一个实心三角形?

GDI InvertRect 的 Direct2D 等效项

机器视觉 dev_set_draw算子

ImageDra绘制二维图像

Direct2D 第6篇 绘制多种风格的线条