Ver Mensaje Individual
  #3 (permalink)  
Antiguo 17/02/2006, 03:49
tammander
 
Fecha de Ingreso: enero-2006
Ubicación: Torroles (Costa der Só)
Mensajes: 1.017
Antigüedad: 19 años, 3 meses
Puntos: 7
Mira a ver si esto te sirve

Código:
if isempty(max_width) then max_width = 80
if isempty(max_height) then max_height = 60

width = 300 ' Tamaño real de la imagen
height = 600 ' Tamaño real de la imagen

x_ratio = max_width / width
y_ratio = max_height / height

if (width <= max_width) AND (height <= max_height) then
  tn_width = width;
  tn_height = height;
elseif (x_ratio * height) < max_height then
  tn_height = int(x_ratio * height)
  tn_width = max_width
else 
  tn_width = int(y_ratio * width)
  tn_height = max_height
end if
tn_width y tn_height contienen el tamaño reducido proporcional con respecto a max_width y max_height



Un saludo

Última edición por tammander; 17/02/2006 a las 10:41