 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Peter Jackson Guest
|
Posted: Mon May 14, 2007 5:15 pm Post subject: Resize the window but aspect ratio remain constant? |
|
|
hi,
I want to resize the window but inside windows objects aspect ratio remain constant.....
Like I have on form . On form i placed one panel.I fixed
the width and height of panel.
When i resize the window , the panel should also be
resized according to form resize but its aspect
ratio(width/height) remain constant....
Please help me
-------
Thanks
Peter Jackson |
|
| Back to top |
|
 |
Bruce Larrabee Guest
|
Posted: Sat May 19, 2007 7:02 pm Post subject: Re: Resize the window but aspect ratio remain constant? |
|
|
Hi Peter,
I'd recommend the following:
1: Calculate the aspect ratio.
2: When the user (or whatever) resizes
the window, calculate the change in size
but adjust the size according to the
aspect ratio that you calculated in step
one. Bias either the width or height
(your choice).
Example:
Window starts at 200 x 160.
200 / 160 = 1.25 <-- your aspect ratio.
Window is resized to 360 x 230.
Bias via height. 230 x 1.25 = 287.5.
Round up to 288.
Set window to 288 x 230.
HTH,
Bruce |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|