Ver Mensaje Individual
  #2  
Antiguo 22-04-2010
Avatar de flystar
flystar flystar is offline
Miembro
 
Registrado: jul 2006
Posts: 184
Reputación: 18
flystar Va por buen camino
BUeno aqui encontre esto:

es una funcion que recibe una imagen jpg y luego la guarda en el disco duro ya con el tamaño que se especifico.

Recibe el nombre de la imagen con todo y ruta y luego donde va a quedar y con que nombre, y el alto y ancho.

function resizeImage(sInImage, sOutImage: string; iHeight, iWidth: integer): boolean;
var JpgImg : TJpegImage;
BmpImg : TBitmap;
Rectangle: TRect;
begin
try
JpgImg := TJpegImage.Create;
BmpImg := TBitmap.Create;

JpgImg.LoadFromFile(sInImage);
Rectangle := Rect(0, 0, iWidth, iHeight);
with BmpImg do
begin
Width := iWidth;
Height := iHeight;
Canvas.StretchDraw(Rectangle, JpgImg);
end;
finally
JpgImg.Assign(BmpImg);
JpgImg.SaveToFile(sOutImage);
JpgImg.Free;
BmpImg.Free;
end;
Result := True;
end;
__________________

"Los unicos que no se equivocan son aquellos que no intentan hacer algo."
Iván Caballero Cano...
ivanhalen77@gmail.com
Responder Con Cita