Solved

Database Jpeg images

Posted on 1998-10-18
3
264 Views
Last Modified: 2010-04-06
I need to know how to use jpegs in a database.
I want the jpegs to be stored in a separate directory, so I need the table to know which jpeg to open based on the other information stored within the database.
In other words When I click on the navigators next button it opens up the relevant Jpeg and so on.
Thanks in advance.
Mike Ross
0
Comment
Question by:mykyl
[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
  • 2
3 Comments
 
LVL 12

Accepted Solution

by:
rwilson032697 earned 100 total points
ID: 1343290
Store the file name of the JPEG in the database table. When you move to a new record in the table with the navigator get the file name and load the JPEG image into an appropriate bitmap on the form.

If you want to store the JPEGs in the actual database table you can use BLOBs etc
0
 

Author Comment

by:mykyl
ID: 1343291
How do I do this. I need to know how to actually put this into practice.
Cheers
0
 
LVL 12

Expert Comment

by:rwilson032697
ID: 1343292
Do it like this:

1. Place a TJPEGImage component on your form.
2. When you need to load an image (record changed...) do this

  var
    AStream : TFileStream;

.
  try
   AStream := TFileStream.Create(TheJPEGFileName, fmOpenRead);
   MyJPEGImage.LoadFromStream(AStream);
 finally
  AStream.Free;
end;

Cheers,

Raymond.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

729 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