[Lazarus] TImage - Getting image properties in 'canvas space'

Reimar Grabowski reimgrab at web.de
Tue Apr 17 22:32:21 CEST 2012


On Tue, 17 Apr 2012 22:19:45 +0200
Sven Barth <pascaldragon at googlemail.com> wrote:

> type
>    TMyHackImage = class(TImage)
>    public
>      function DestRect: TRect;
>    end;
> 
> var
>    MyImage: TImage;
>    r: TRect;
> begin
>    // let's suppose that MyImage contains a TImage instance
>    r := TMyHackImage(MyImage).DestRect
> end;
How should that work?
What does the DestRec function look like?
IMHO to access DestRec TMyHackImage must be derived from TCustomImage and in that case the cast won't work.

R.




More information about the Lazarus mailing list