Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Go Back   Foros Club Delphi > Principal > Gráficos
Register FAQ Members List Calendar Guía de estilo Today's Posts

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 05/06/2006
enecumene's Avatar
[enecumene] enecumene is offline
Miembro de Oro
 
Join Date: May 2006
Location: Santo Domingo, Rep. Dom.
Posts: 3,040
Poder: 24
enecumene Va por buen camino
Exclamation Novato (Redimensionar imagen)

Saludos!!!

tengo un problema, usos paradox 7 y delphi 7, en mi aplicacion cargo imagenes jpeg en un timage y todo funciona perfecto se carga y se muestra, pero que la imagen se muestra mas grande que el tamaño del timage, como hago para que la imagen tenga el mismo tamaño del TImage? aqui os dejo mi codigo para cargar imagen:

Código Delphi [-]
procedure TForm3.mnuLoadClick(Sender: TObject);
var
    Jpg: TJpegImage;
    Stream: TMemoryStream;
    FileExt: string;
    GraphType: TGraphType;
  begin
    if dlgOpenPicture.Execute then begin
      Jpg := nil;
      Stream := nil;
      try
        Stream := TMemoryStream.Create;
        FileExt := LowerCase(ExtractFileExt(dlgOpenPicture.FileName));
        if (FileExt = '.bmp') or (FileExt = '.dib') then begin
          GraphType := gtBitmap;
          Stream.Write(GraphType, 1);
          with Image1.Picture.Bitmap do begin
            LoadFromFile(dlgOpenPicture.FileName);
            Image1.Picture.Bitmap.SaveToStream(Stream);
          end;
        end else if (FileExt = '.ico') then begin
          GraphType := gtIcon;
          Stream.Write(GraphType, 1);
          with Image1.Picture.Icon do begin
            LoadFromFile(dlgOpenPicture.FileName);
            Image1.Picture.Bitmap.SaveToStream(Stream);
          end;
        end else if (FileExt = '.emf') or (FileExt = '.wmf') then begin
          GraphType := gtMetafile;
          Stream.Write(GraphType, 1);
          with Image1.Picture.Metafile do begin
            LoadFromFile(dlgOpenPicture.FileName);
            Image1.Picture.Bitmap.SaveToStream(Stream);
          end;
        end else if (FileExt = '.jpg') or (FileExt = '.jpeg')
           or (FileExt = '.jpe') then begin
          Jpg := TJpegImage.Create;
          Jpg.LoadFromFile(dlgOpenPicture.FileName);
          Image1.Picture.Assign(Jpg);
          GraphType := gtJpeg;
          Stream.Write(GraphType, 1);
          Jpg.SaveToStream(Stream);
        end;
        if (tblPeliculas.State <> dsEdit) and (tblPeliculas.State <> dsInsert) then
          tblPeliculas.Edit;
        Stream.Position := 0;
        TBlobField(tblPeliculas.FieldByName('Imagen')).LoadFromStream(Stream);
      except
        jpg.Free;
        Stream.Free;
        raise;
      end;
      jpg.Free;
      Stream.Free;
    end;
end;

espero que me puedan ayudar y hayan podido entender mi duda.

gracias!!!!

Last edited by dec : 05/06/2006 at 20:18.
Reply With Quote
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Novato (Cargando imagen con jvDBImage) enecumene Conexión con bases de datos 4 05/06/2006 22:01
Redimensionar Imagen a tamaño del formulario! kye_z Varios 2 09/11/2004 09:44
Pregunta de novato.. pero de muy novato CFPA86 PHP 1 08/08/2004 06:53
Redimensionar imagen jpeg xflo Gráficos 0 01/07/2003 12:46
Redimensionar JPG xflo Lazarus, FreePascal, Kylix, etc. 0 01/07/2003 12:43


All times are GMT +2. The time now is 21:10.


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
Copyright 1996-2007 Club Delphi