buneo he estado busca y busca y he encontrado algunos codigos, he hehco paso a paso lo q iban diciendo y si he logrado hacerlo pero cuando ya quiero ver la foto, ejecutar el programa para ver si se peude me sale un error en el codigo y por mas vuelta q le doy no veo dond esta el fallo ya q muchos codigos son iguales
aki les dejo el codigo q llevo
unit database;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, DB, ADODB, Grids, DBGrids;
type
TForm1 = class(TForm)
DBGrid1: TDBGrid;
ADOTable1: TADOTable;
DataSource1: TDataSource;
ADOConnection1: TADOConnection;
ADOimage: TImage;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
uses jpeg;
{$R *.dfm}
function 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;
procedure TForm1.Button1Click(Sender: TObject);
var
bS : TADOBlobStream;
Pic : TJpegImage;
begin
bS := TADOBlobStream.Create
(AdoTable1Picture, bmRead);
try
bS.Seek(JpegStartsInBlob(AdoTable1Picture),
soFromBeginning);
Pic:=TJpegImage.Create;
try
Pic.LoadFromStream(bS);
ADOImage.Picture.Graphic:=Pic;
finally
Pic.Free;
end;
finally
bS.Free
end;
end;
y aki me da el error, es en el boton
bS := TADOBlobStream.Create
(AdoTable1Picture, bmRead);
a dond dice Adotable1picture, bmread a ver si me pueden decir el error ahi ya t se supone q esta bien todo porq lo saque d aki
delphi.about.com/od/database/l/aa030601d.htm
porq me da un error??