Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Bases de datos > Firebird e Interbase
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

 
 
Herramientas Buscar en Tema Desplegado
  #2  
Antiguo 20-07-2004
Avatar de tcp_ip_es
tcp_ip_es tcp_ip_es is offline
No confirmado
 
Registrado: ago 2003
Ubicación: Madrid
Posts: 635
Poder: 0
tcp_ip_es Va por buen camino
Aquí te dejo un ejemplito donde meto una imagen en una tablita:
Código Delphi [-]
procedure TFFotos.CargarImagen2Click(Sender: TObject);
begin
 if opendialog1.Execute then
  begin
   TFotos.Append
   if TFotosFoto = NIL then TFotos.APPend
   else TFotos.Edit;
   TFotosFoto.LoadFromFile(opendialog1.FileName);
   TFotosTipo.Value := ansiuppercase(extractFileExt(opendialog1.FileName));
   TFotos.Post;
   TFotosAfterScroll(TFotos);
  end;
end;

procedure TFFotos.TFotosAfterScroll(DataSet: TDataSet);
var
 wTipo : byte;
 blob : tmemorystream;
 imJPG : TJpegImage;
begin
 blob := tmemorystream.create;
 imJPG := TJPEGIMage.create;
 try
   if TFotosTipo.Value = '.BMP' then wtipo := 0;
   if pos(TFotosTipo.Value,'.WMF.EMF') > 0 then wtipo := 1;
   if TFotosTipo.Value = '.JPG' then wtipo := 2;
   TFotosFoto.savetostream(blob);
   blob.position := 0;
   if blob.Size > 0 then
     case wtipo of
       0: Image1.Picture.bitmap.loadfromstream(blob);
       1: Image1.Picture.metafile.loadfromstream(blob);
       2:
        begin
         imJPG.LoadFromStream(blob);
         Image1.Picture.assign(imjpg);
        end;
     end
    else
     begin
      image1.picture.metafile := NIL;
      image1.picture.bitmap := NIL;
      image1.picture.Graphic := NIL;      
     end;
  finally
   Blob.Free;
   imJPG.Free;
  end;
end;

Espero que te sirva....

Saludos, Tony
Responder Con Cita
 



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro


La franja horaria es GMT +2. Ahora son las 20:12:06.


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