2005-07-06, 03:28 PM
im having trouble with zooming in/out and the x,y why points in my pictures. everytime i do it, i get the formula wrong, and i got sick of trying. so whose good at maths? the variable i have to work with are
zoomfactor = how much the pic is zoomed in by
oldzoomfactor = the old zoom factor
oldX, oldY, oldWidth, oldHeight = old image dimensions.
newX, newY, newWidth, newHeight = new image dimensions.
to get the newwidth/height i just do oldWidth/oldzoomfactor * newzoomfactor. but how do i get the newx/y? i havent done any maths in years, and i looks like ive forgotten most things (im sure i could do this back in highschool). so anyway, anyone know the solution?
cheers,
reven.
zoomfactor = how much the pic is zoomed in by
oldzoomfactor = the old zoom factor
oldX, oldY, oldWidth, oldHeight = old image dimensions.
newX, newY, newWidth, newHeight = new image dimensions.
to get the newwidth/height i just do oldWidth/oldzoomfactor * newzoomfactor. but how do i get the newx/y? i havent done any maths in years, and i looks like ive forgotten most things (im sure i could do this back in highschool). so anyway, anyone know the solution?
cheers,
reven.