Canvas does not allow drawing.
From: Skybuck Flying (nospam_at_hotmail.com)
Date: 12/31/04
- Next message: BedBaol: "THANK'YOU"
- Previous message: Jamie: "Re: TWebBrowser steals focus when minimised"
- Next in thread: Rob Kennedy: "Re: Canvas does not allow drawing."
- Reply: Rob Kennedy: "Re: Canvas does not allow drawing."
- Reply: Jamie: "Re: Canvas does not allow drawing."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 31 Dec 2004 07:20:01 +0100
Hi,
Start a new application and place an Timage on the form and load a little
picture into it.
Then place a timer on the form and set the interval to 50 or so.
Then paste this code into the timer event handler.
Then simply let it run a while. (It will draw the little picture onto the
desktop)
After a while it will "crash" Debugger notification exception (?) and say:
"Canvas does not allow drawing".. etc.
Why does this happen and what is the solution (if any ;)) ?
procedure TForm1.Timer1Timer(Sender: TObject);
var
DesktopCanvas : TCanvas;
begin
DesktopCanvas := TCanvas.Create;
DesktopCanvas.Handle := GetDC(0);
DesktopCanvas.Draw( 50, 50, Image1.Picture.Graphic );
DesktopCanvas.Destroy;
end;
Bye,
Skybuck
- Next message: BedBaol: "THANK'YOU"
- Previous message: Jamie: "Re: TWebBrowser steals focus when minimised"
- Next in thread: Rob Kennedy: "Re: Canvas does not allow drawing."
- Reply: Rob Kennedy: "Re: Canvas does not allow drawing."
- Reply: Jamie: "Re: Canvas does not allow drawing."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|