Solved

Database Jpeg images

Posted on 1998-10-18
3
257 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
  • 2
3 Comments
 
LVL 12

Accepted Solution

by:
rwilson032697 earned 100 total points
Comment Utility
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
Comment Utility
How do I do this. I need to know how to actually put this into practice.
Cheers
0
 
LVL 12

Expert Comment

by:rwilson032697
Comment Utility
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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

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…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

744 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

15 Experts available now in Live!

Get 1:1 Help Now