Ver Mensaje Individual
  #6  
Antiguo 16-03-2012
Avatar de jafera
jafera jafera is offline
Miembro
 
Registrado: may 2007
Ubicación: Llagostera (Girona)
Posts: 582
Reputación: 18
jafera Va por buen camino
Gracias Ecfisa.

Tu proposición funciona bien, solo que tengo un pequeño problema, al asignarle la imagen el TDBImage, me dice que bitmap image is not valid.

He probado con un TImage a secas asignandole el valor y funciona, solo que me muestra una sola foto y no toda la hilera

Código Delphi [-]
 
procedure TF_Camions.Fotos_CAfterScroll(DataSet: TDataSet);
var
        jpg:TJpegImage;
        foto:TMemoryStream;
begin
        If FileExists('C:\Bombers_1.0\Temp\Temporal.jpg') then
        DeleteFile ('C:\Bombers_1.0\Temp\Temporal.jpg');
        If Fotos_CFOTO.Value<>'' then
        begin
                Jpg:=TJpegImage.create;
                Foto:=TMemoryStream.create;
                try
                        Fotos_CFOTO.SaveToStream(Foto);
                        Foto.Seek(0,soFromBeginning);
                        Jpg.LoadFromStream(Foto);
                        Jpg.SaveToFile('C:\Bombers_1.0\Temp\Temporal.jpg');
                        if jpg.Width > jpg.Height then
                        begin
                                Image2.Width := 500;
                                Image2.Height := 376;
                                Image2.Picture.Assign(Jpg);
                                Image1.Width := 500;
                                Image1.Height := 376;
                                Image1.Stretch:=False;
                                Image1.Picture.Assign(Jpg);
                                Image4.Width:=50;
                                Image4.Height:=37;
                                Image4.Stretch:=True;
                                Image4.Picture.Assign(Jpg); 
                        end
                        else
                        begin
                                Image2.Width := 376;
                                Image2.Height:=500;
                                Image2.Picture.Assign(Jpg);
                                Image1.Width := 282;
                                Image1.Height := 376;
                                Image1.Stretch:=True;
                                Image1.Picture.Assign(Jpg);
                                Image4.Width:=37;
                                Image4.Height:=50;
                                Image4.Stretch:=True;
                                Image4.Picture.Assign(Jpg); 
                        end;
                finally
                        Foto.Free;
                        Jpg.Free;
                end;
        end
        else
        begin
                Image2.Picture.Assign(nil);
                Image1.Picture.Assign(nil);
                Image4.Picture.Assign(nil);
        end;
end;

Gracias de nuevo

Josep
Responder Con Cita