Solved

how to show jpeg file with DBimage?

Posted on 2004-08-13
3
1,264 Views
Last Modified: 2013-11-19
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
Comment
Question by:selas
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 25

Expert Comment

by:Tomas Helgi Johannsson
ID: 11794185
    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
 
LVL 14

Expert Comment

by:Pierre Cornelius
ID: 11794532
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
 
LVL 22

Accepted Solution

by:
Mohammed Nasman earned 500 total points
ID: 11797527
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Many programs have tried to outwit PowerPoint in terms of technology and skill. These programs, however, still lack several characteristics that PowerPoint has possessed from the start. Here's why PowerPoint replacements won't entirely work for desi…
In this Micro Tutorial viewers will learn the basic shortcuts and functions of Illustrator. The viewer will learn about the paintbrush tool, anchor points, font sizing, and more.
Learn how to create interesting presentations by including videos to keep your audience engaged using Prezi. Select "Insert" from the top menu in your Prezi editor: Select "YouTube Video": Paste the video URL into the prompt: "Select "Insert":…

690 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question