Newsgroups : Borland : borland.public.delphi.nativeapi.win32 : 2005 Mar : Stupid TCanvas question

www.cryer.info
Managed Newsgroup Archive

Stupid TCanvas question

Subject:Stupid TCanvas question
Posted by:"Ronaldo Souza" (ronal..@hw.ind.br)
Date:Wed, 2 Mar 2005 16:47:43

I'm thinking about generalizing a bunch of printing procedures so they
would work with any Canvas, which would passed as a parameter, but I
CANNOT alter the caller's canvas. I thought this would do the trick but
some annoying doubts came to my mind:

procedure MyCanvasProc(ACanvas : TCanvas);
var
    MyLocalCanvas : TCanvas;
begin
    // Is the original canvas preserved ?

    MyLocalCanvas := TCanvas; // What actually happens here ?

    . . .
    with MyLocalCanvas do
    begin
      write & draw a bunch of stuff...
    end;
    . . .

    // Do I have to free anything here ?
end;

TIA,
Ronaldo

Replies:

www.cryer.info
Managed Newsgroup Archive