//多边形描边与填充 var g: TGPGraphics; p: TGPPen; sb: TGPSolidBrush; pts: array[0..4] of TGPPoint; begin g := TGPGraphics.Create(Canvas.Handle); sb := TGPSolidBrush.Create(MakeColor(255,255,255)); p := TGPPen.Create(MakeColor(255,0,0),4); pts[0].X := 11; pts[0].Y := 11; pts[1].X := 66; pts[1].Y := 111; pts[2].X := 88; pts[2].Y := 222; pts[3].X := 111; pts[3].Y := 88; pts[4].X := 222; pts[4].Y := 66; g.DrawPolygon(p, PGPPoint(@pts), Length(pts)); {第二个参数是指针类型, 需亚转换} g.FillPolygon(sb, PGPPoint(@pts), Length(pts)); {第三个参数是顶点数} p.Free; sb.Free; g.Free; end;
GDI+ 学习记录(15): 多边形 - Polygon
最新推荐文章于 2022-10-27 12:45:02 发布