I intend to use TMetafileCanvas so I have started to find example. On Embarcadero side I have find the following example:
var
MyMetafile: TMetafile;
procedure TForm1.Button1Click(Sender: TObject);
begin
MyMetafile := TMetafile.Create;
with TMetafileCanvas.Create(MyMetafile, 0) do
try
Brush.Color := clRed;
Ellipse(0, 0, 100, 200);
// ...
finally
// Free;
end;
Form1.Canvas.Draw(0, 0, MyMetafile); {1 red circle }
PaintBox1.Canvas.Draw(0, -50, MyMetafile); {1 red circle }
end;
I have created a new project and put on the Form, Button and PaintBox, then I have copy upper example, but nothing is happened when the code is executed and the form stay the same!
Evidently I'm doing something wrong! What I have to do that example should work correct?