Page 1 of 1

zooming / resizig problem

Posted: Wed Jul 04, 2007 10:55 am
by 8443014
Hi,
project that has a Tree aligned to its client area in a panel and I want to get the tree to resize as the form is resized. I would like to fit the tree picture within the available space, this is to render the best possible image at various screen resolutions. I have tried using Zoom and this looks very promising - I can resize the from and the tree image follows this but I cannot work out how the margins should be calculated - the
horiz and very margins seem to change as the zoom occurs. This gives the problem that the imageshape (and the contianed image) moves out of the panel client area. Btw, the same happens in the TTree feature demo, Tree Features / Zooming, if you zoom in and out several times having not chekced the zoom from center property.

Is zoom the best way to do this? Could someone point me at how to keep the image fitting correctly within the form as the form is resized?


TIA

Markus

P.s.: Tom , I sent you a PM because I didnt't know where to sent the source code example for the transparent image problem - did you get it ?

Posted: Wed Jul 04, 2007 9:47 pm
by Tom
Hi Thomas,

Concerning transparent images: I've replied on the PM, but never received a return, so I guess something went wrong. Please send the source example to tom at steema com

Concerning the Zooming/Scrolling and Margins: Well, as designed ttree 'trims' empty spaces at the top and left side of the tree. This might be the issue you are seeing. You can disable this by enabling using the PAGEBOUNDS define (see {$DEFINE PAGEBOUNDS} in teeTree.pas)

(keep in mind that you might experience other issues when disabling, if so, let us know)

Regards,
Tom.

Posted: Thu Jul 12, 2007 7:59 pm
by 9231208
Markus,

I have some autosizing code from Tom that does a reasonable job of sizing a TTree's contents, to fit its current size.

If you want to have a look at it, please drop me an e-mail at: keithb(at)kbsoft(dot)com.


Regards,
Keith