Ver Mensaje Individual
  #2  
Antiguo 19-01-2007
Avatar de Doraemon
Doraemon Doraemon is offline
Registrado
 
Registrado: abr 2005
Ubicación: Ñemby Paraguay
Posts: 5
Reputación: 0
Doraemon Va por buen camino
Talking Ya encontre la solucion...

Estuve buscando mas ejemplos y pude solucionar mi problema...

Acá pongo el codigo que quedo finalmente:

Código Delphi [-]procedure TfraDefinicionNotificadores.MostrarFoto; var bS : TADOBlobStream; Pic : TJpegImage; begin bS := TADOBlobStream.Create(ADONotificadoresFoto, bmRead); try bS.Seek(JpegStartsInBlob(ADONotificadoresFoto), soFromBeginning); Pic:=TJpegImage.Create; try if Length(ADONotificadoresFoto.AsString)>0 then begin Pic.LoadFromStream(bS); imgFoto.Picture.Graphic:=Pic; end else imgFoto.Picture.Assign(nil); finally Pic.Free; end; finally bS.Free end; end;


Código Delphi [-]function TfraDefinicionNotificadores.JpegStartsInBlob( PicField: TBlobField): integer; var bS : TADOBlobStream; buffer : Word; hx : string; begin Result := -1; bS := TADOBlobStream.Create(PicField, bmRead); try while (Result = -1) and (bS.Position + 1 < bS.Size) do begin bS.ReadBuffer(buffer, 1); hx:=IntToHex(buffer, 2); if hx = 'FF' then begin bS.ReadBuffer(buffer, 1); hx:=IntToHex(buffer, 2); if hx = 'D8' then Result := bS.Position - 2 else if hx = 'FF' then bS.Position := bS.Position-1; end; //if end; //while finally bS.Free end; //try end;
Responder Con Cita