Solved

how to show jpeg file with DBimage?

Posted on 2004-08-13
3
1,253 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
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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

Suggested Solutions

Title # Comments Views Activity
Printing problem 2 102
Configuring Autocad with a Quadro K4000 graphics card 23 285
SUM 2 INTEGER ARRAYS INTO 1 10 108
shape, triangle, dbctrlgrid 3 17
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
In this tutorial viewers will learn how to create blended and gradiated shapes in Illustrator using the blend tool Draw two shapes, one of them in a different color: Select both and create a blend by going to Object > Blend > Make: Blends can also b…
Learn how to download your full Prezi presentation for offline presenting. Prezi doesn’t have to be viewed and shared in a web browser, even with a free account you can download your full presentation to share with others. Be sure to download any vi…

820 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