I need to pass the canvas of the VCL as parameter to some methods who in turn do some drawing operations on the canvas. For this I need to do class casting from TCavas3D to TCanvas and vice a versa. But it seems that since both of these are not compatible so compiler complains and does not even compiles the code.
Can some one please help some alternative.
Thanks in advance
How to cast TCanvas3D to TCanvas and vice a versa
-
- Newbie
- Posts: 10
- Joined: Wed Sep 28, 2005 4:00 am
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Sunil,
To cast from a TCanvas3D to a TCanvas you can use this:
For the inverse operation this:
To cast from a TCanvas3D to a TCanvas you can use this:
Code: Select all
DBChart1.Canvas.ReferenceCanvas
Code: Select all
var MyCanvas: TCanvas;
begin
MyCanvas:=TCanvas.Create;
(MyCanvas as TCanvas3D).Rectangle(...);
end;
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |