[gameprogrammer] Re: Image sizing with constrain

  • From: Robbert de Groot <zekaric@xxxxxxxx>
  • To: gameprogrammer@xxxxxxxxxxxxx
  • Date: Wed, 28 Jul 2004 12:40:18 -0400 (EDT)

Oops.  You wanted the y to reduce by 70...  

X / (300 - 70) = 400 / 300
             X = (400 * (300 - 70)) / 300
             X = 306.666...

So 307ish pixels in the X.  Same formula though.

--- Robbert de Groot <zekaric@xxxxxxxx> wrote: 
> Y / (400 - 70) = 300 / 400
>              Y = (300 * (400 - 70)) / 400;
>              Y = 247.5
> 
> So 247 or 248 pixels in the y will be needed.
> 
> The mathy formula.
> 
> X/Y = X'/Y'
> 
> which is just making the aspect ratios match.
> 
> 
> --- Orel Beckford <force_ogb@xxxxxxxxx> wrote: > Hi
> > I have'nt posted to this list for months, still
> > reading you mails :-)
> > 
> > I having a problem trying to resize an image with
> > constrain.  for example if I have an image which was
> > 400 x 300 and I wanted to reduce the x of the image by
> > 70,  I need to calculate what the reduction of y
> > should be, to keep the image looking like the the
> > original but smaller, if I was to reduce the y by 70
> > also the image looks a bit stretched, does anyone have
> > the formular to work out how much to reduce the y by.
> 
> 
> ______________________________________________________________________ 
> Post your free ad now! http://personals.yahoo.ca
> 
> 
> ---------------------
> To unsubscribe go to http://gameprogrammer.com/mailinglist.html
> 
> 
>  

______________________________________________________________________ 
Post your free ad now! http://personals.yahoo.ca


---------------------
To unsubscribe go to http://gameprogrammer.com/mailinglist.html


Other related posts: