我正在尝试DrawCurve
从 GDIPOBJ.pas 文件中调用一个函数。代码片段:
uses
..., GDIPAPI, GDIPOBJ;
...
const Points: array [0..3] of TGPPointF = (
(X: 30.67; Y: 0),
(X: 70.68; Y: 30),
(X: 100.5; Y: 70),
(X: 290.8; Y: 110));
var
Pen: TGPPen;
IGPG: TGPGraphics;
begin
IGPG := TGPGraphics.Create(Handle);
Pen := TGPPen.Create(clBlue,2);
IGPG.DrawCurve(Pen, Points, 4); // !!!!! [Error] There is no overloaded version of 'DrawCurve' that can be called with these arguments !!!!!
end;
我们看一下GDIPOBJ.pas文件中对DrawCurve的描述:
function TGPGraphics.DrawCurve(pen: TGPPen; points: PGPPointF; count: Integer): TStatus;
begin
result := SetStatus(GdipDrawCurve(nativeGraphics,
pen.nativePen, points,
count));
end;
在上面的函数中,我设置了 TGPPen (Pen), PGPPointF (Points), Integer (4)。怎么了?
我也试过直接通过API函数执行:
GdipDrawCurve(IGPG, Pen, Points, 4);
它对第三个参数发誓:
不兼容的类型:“Array”和“PGPPointF”
但是 Points 数组实际上由 PGPPointF 组成......