论坛


2011年3月31日 星期四

Direct2D (5) : 绘制自定义图形

万一| 万一的 Delphi 博客 |21:09:00

下面是通过自定义函数绘制菱形的测试代码。uses Direct2D, D2D1; {自定义的绘制菱形的函数} procedure Diamond(d2dCanvas: TDirect2DCanvas; ptLeft, ptTop: TD2DPoint2f); var path: ID2D1PathGeometry; //路径接口 sink: ID2D1GeometrySink; //给路径添加图形...

Direct2D (4) : DrawGeometry() 与 FillGeometry()

万一| 万一的 Delphi 博客 |17:42:00

原始的 Direct2D 只提供了几种简单图形(直线、矩形、圆角矩形、椭圆)的绘制与填充,更多集合图形或路径的描绘要使用 DrawGeometry() 和 FillGeometry()。既然能绘制更复杂的图形,当然也能绘制基本图形,先试下使用 DrawGeometry()、FillGeometry() 实现矩形、圆角矩...

Direct2D (3) : 使用浮点参数绘制基本图形

万一| 万一的 Delphi 博客 |14:01:00

{相关方法} TDirect2DCanvas.DrawEllipse(); TDirect2DCanvas.DrawLine(); TDirect2DCanvas.DrawRectangle(); TDirect2DCanvas.DrawRoundedRectangle(); TDirect2DCanvas.FillEllipse(); TDirect2DCanvas.FillRectangle(); TDirect2DCanvas.FillRoundedRectangle(); ...