BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Resize the window but aspect ratio remain constant?

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Usage)
View previous topic :: View next topic  
Author Message
Peter Jackson
Guest





PostPosted: Mon May 14, 2007 5:15 pm    Post subject: Resize the window but aspect ratio remain constant? Reply with quote



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





PostPosted: Sat May 19, 2007 7:02 pm    Post subject: Re: Resize the window but aspect ratio remain constant? Reply with quote



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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Usage) All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.