Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   Gráficos (https://www.clubdelphi.com/foros/forumdisplay.php?f=8)
-   -   TJpegImage u otro (https://www.clubdelphi.com/foros/showthread.php?t=4923)

daly 02-11-2003 16:06:52

TJpegImage u otro
 
Hola al foro!
estoy intentado hacer un programa para redimensionar el tamaño de un jpg.
He probado con el siguiente código de la web q3.nu
Pero ocupa demasiado y la resolución es pésima.
Sabeis de algún objeto u otra forma de hacerlo.
Gracias
DAly
var
registro:TSearchRec;
i:byte;
bmp: TBitmap;
jp: TJpegImage;
begin
if (findfirst(path + '\*.jpg',(faAnyFile ),registro))=0 then
begin
if not DirectoryExists(path+'\n') then
CreateDir(path+'\n\p');
i:=1;
repeat
jpg := TJpegImage.Create;
jpg.Loadfromfile(path+'\'+registro.Name);
bmp := TBitmap.Create;
bmp.Width:=strtoint(EditAncho.Text);
bmp.Height:=(jpg.Height * strtoint(EditAncho.text)) div jpg.Width;
bmp.Canvas.StretchDraw(bmp.Canvas.Cliprect, jpg);
jpg.Assign(bmp);
jpg.SaveToFile(path+'\n\'+inttostr(i) + '.jpg');
bmp.Free;
jpg.Free;
i:=i+1;
until findnext (registro)<>0
end;

Julià T. 03-11-2003 01:32:21

Quizá te sirva un componente que tengo en mi página personal (TSaveImage) en http://joul.webcindario.com

jplj 16-11-2003 21:20:16

Junto con delphi viene un ejemplo que quiza pueda servirte, está en:

C:\Archivos de programa\Borland\Delphi5\Help\Examples\Jpeg

Saludos
Juan Pedro.


La franja horaria es GMT +2. Ahora son las 21:36:38.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi