View Single Post
  #17  
Old 02-28-2010, 03:21 PM
Jasser Jasser is offline
Moderator
 
Join Date: Jan 2005
Location: Saudi Arabia
Posts: 5,059
Default

Create a new form "Form2" with a TImage & TADOQuery on it and use the bellow code:


Code:
procedure TForm1.Button1Click(Sender: TObject);
var
          oStream : TStream;
begin
          Form2 := TForm2.Create(self);
          Form2.ADOQuery1.Close;
          Form2.ADOQuery1.SQL.Clear;
          Form2.ADOQuery1.SQL.Add('select CompanyLogo from Table1');
          Form2.ADOQuery1.Open;

          oStream := Form2.ADOQuery1.CreateBlobStream(Form2.ADOQuery1.FieldByName('CompanyLogo'),bmRead);
          oStream.Seek(0, soFromBeginning);

          Form2.Image1.Picture.Bitmap.LoadFromStream(oStream);
          Form2.ShowModal;
          Form2.Free;

          oStream.Free;
end;
__________________
Regards,
Abdulaziz Jasser
Reply With Quote