Пытаюсь вызвать функцию 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;
Смотрим описание DrawCurve в файле GDIPOBJ.pas:
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);
Тут ругается на третий параметр:
Incompatible types: 'Array' and 'PGPPointF'
Но ведь массив Points как раз-таки и состоит из PGPPointF...
const Points
может быть преобразовано вPGPPointF
?type PGPPointF = ^TGPPointF; TGPPointF = packed record X : Single; Y : Single; end; TPointFDynArray = array of TGPPointF;