[Lazarus] TImage - Getting image properties in 'canvas space'
Marc Weustink
marc.weustink at cuperus.nl
Tue Apr 17 12:12:21 CEST 2012
Mattias Gaertner wrote:
>
> Reimar Grabowski <reimgrab at web.de> hat am 16. April 2012 um 16:42
> geschrieben:
>
> > Hi,
> >
> > I load a TLazIntfImage from disk, manipulate it and show it on my
> form in a TImage. Center, Proportional and Stretch properties of the
> TImage are set to true.
> > Now I want to draw some overlays onto it (drawing to the canvas in
> the OnPaint event). Therefor I obviously need the origin and dimensions
> of the loaded image in 'canvas space', but I did not find a way to
> retrieve this information. Do I have to calculate them myself or can the
> TImage give me the needed information?
>
> The image is painted to the area defined by the protected method DestRect.
>
> Maybe this can be made public.
>
> At the moment you have to descend your own TImage class to access it or
> write a hack class (e.g. via a class helper).
TImage is not meant to draw to. If you want to custom paint your image,
use a TPaintbox
A TImage is for display only.
Marc
More information about the Lazarus
mailing list