Hi, I am writing a component.
I do something like the Paint method below.
The problem is that the two Canvas.Ellipse calls dosn't draw on the same
place on the canvas, so GDI plus must change the coordinate system somehow.
How can I fix this?
regards,
David
procedure TMyControl.Paint;
var
g: TGPGraphics;
p: TGPPen;
begin
g := TGPGraphics.Create(Canvas.Handle);
p := TGPPen.Create(MakeColor(127, 255, 0, 255));
try
Canvas.Ellipse(Bounds(10, 10, 20, 20));
g.DrawEllipse(10, 10, 20, 20);
Canvas.Ellipse(Bounds(10, 10, 20, 20));
finally
g.Free;
end;
end;
--
mvh,
David