• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1314
  • Last Modified:

how to show jpeg file with DBimage?

My sql databese store blob field with jpeg image
i'm using Dbctrlgrid and DB image on it
But then i open query (Select id, picture from people where id <10) i get error: 'Bitmap image not valid'
How can i show JPEG image?
0
selas
Asked:
selas
1 Solution
 
Tomas Helgi JohannssonCommented:
    Hi

I think you will the answer on this webpage : http://www.tek-tips.com/gviewthread.cfm/pid/102/qid/886254
Check out the EDBImage and QREDBImage v.1.4 on http://www.torry.net/pages.php?id=533


Regards,
  Tomas Helgi
0
 
Pierre CorneliusCommented:
It sounds to me like the JPeg graphic class/format is not registered.
Do you have the JPeg unit in your USES clause? Adding the JPeg unit to your uses clause will automatically register the graphic class. Try it. If it still doesn't work, let me know, I have a few other ideas...

Regards

Pierre Cornelius

0
 
Mohammed NasmanSoftware DeveloperCommented:
Hello selas

  DBImage doesn't support Jpeg format, but you can find other DBImage components that support that, I tried few free ones, but have problems with them, so I changed to use Image component which is easy to use for showing any images from database

Here's a sample for showing the images from AdoQuery on DBCtrlGrid, without needing to any other components just drop Image component into the DBCtrlGrid, write few lines for DBCtrlGrid OnPainPanel event, and every thing will work fine ;-)


uses
  Jpeg;

procedure TForm2.DBCtrlGrid1PaintPanel(DBCtrlGrid: TDBCtrlGrid;
  Index: Integer);
begin
try
  TBlobField(AdoQuery1.FieldByName('picture')).SaveToFile('temp.jpg');
  Image1.Picture.LoadFromFile('temp.jpg');
except
end;
end;

HTH

Regards,
Mohammed Nasman
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now