Ver Mensaje Individual
  #4 (permalink)  
Antiguo 24/07/2008, 01:38
Ciberyo
 
Fecha de Ingreso: diciembre-2007
Mensajes: 36
Antigüedad: 17 años, 2 meses
Puntos: 0
Respuesta: Galeria de imagenes

Acabo de ver tu mensaje , justo ayer habia encontrado una funcion que tambien vale , la pongo por si a alguien no le funciona la que has puesto tu Ivan

Código:
 const int Lx = 173;
                //  Ancho maximo para las miniaturas
                const int Ly = 234;
                float l2;
                float newHeight, newWidth;
                //  Alturam axima para las miniaturas
                if (((myBitmap.Width / Lx) > (myBitmap.Width / Ly)))
                {
                    l2 = myBitmap.Width;
                    newWidth = Lx;
                    newHeight = (myBitmap.Height * (Lx / l2));
                    if ((newHeight > Ly))
                    {
                        newWidth = (newWidth * (Ly / newHeight));
                        newHeight = Ly;
                    }
                }
                else
                {
                    l2 = myBitmap.Height;
                    newHeight = Ly;
                    newWidth = (myBitmap.Width
                                * (Ly / l2));
                    if ((newWidth > Lx))
                    {
                        newHeight = (newHeight * (Lx / newWidth));
                        newWidth = Lx;
                    }
                }
La comento 1 poco : Comprueba si es una imagen mas alta o ancha antes de redimensionar y luego redimensiona en la misma proporcion y en funcion al tamaño maximo que le hemos indicado.

Ahora estoy trabajando en hacerle un crop, solo me falta la libreria, cuando este listo lo subo