Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   OOP (https://www.clubdelphi.com/foros/forumdisplay.php?f=5)
-   -   alguien me puede ayudar con optimización? (https://www.clubdelphi.com/foros/showthread.php?t=55721)

mrnovice 24-04-2008 19:13:54

alguien me puede ayudar con optimización?
 
Holas, primero que nada gradeciendo todo el apoyo de clubdelphi, miren lo que pasa es que estoy desarrollando una aplicación que escánea imagenes y las acomoda en thumbnails, los componentes que uso son JVThumbView, TDelphiTwain, y VampyreImagingLibrary, use el procedimiento para hacer un thumbnail de la iamgen escaneada con el resizeimage de V.I.L.,el primer mètodo que use es usando archivos, el escanear varias imagenes por ejemplo 6 se tardo enq ue apareciera las imágenes, luego decidir hacer una mejora, en teoria para quitar procesos usando el streams,entonces pues no me funcionó :( nose si alguien me pudiera ayudar a optimizar el código, voy a elaborar para que aparezcan los tiempos,saludos ojala se logre algo :)

aquí esta el código

Código Delphi [-]
procedure TFormMain.GetThumbnail(nume_image:integer);
var
   i:integer;
   ImgBitmap: TImagingBitmap;
   ImgData: TImageData;
   Bitmap: TBitmap;
   Jpg: TJPEGImage;
   stream : Tstream;
   Asize:longint;
   {}
   Width, Height: Integer;
  begin
      jvthumbview1.EmptyList;
      FOR i := 0 TO ImageList.Count - 1 DO
         begin
            Jpg:= TJPEGImage.Create;
            stream := TMemoryStream.Create;
            Imaging.InitImage(ImgData);
            try
              jpg.assign(TBitmap(ImageList[i]));
              //Jpg.CompressionQuality:= 10;
              Jpg.SaveToStream(stream);
              ASize := stream.Size;
              stream.position := 0 ;
              Imaging.LoadImageFromStream(stream,ImgData);
              Imaging.ResizeImage(ImgData,248,350,rfbilinear);
              stream.Position:=0;
              Imaging.SaveImageToStream('jpg',stream,ImgData);
              stream.Position:=0;
              fi:=fi+1;
              jvthumbview1.AddFromStream(stream,grJPG,'Thumb'+IntToStr(fi));
              stream.Free;
             finally
               Jpg.Free;
             end;
         end;
          // assign(TBitmap(ImageList[i]));
  end;


La franja horaria es GMT +2. Ahora son las 18:08:12.

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