Solved

how to show jpeg file with DBimage?

Posted on 2004-08-13
3
1,239 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 24

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:
mnasman 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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
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 how to remove an unwanted object using Photoshop’s feature known as content-aware fill.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.

708 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now