Solved

Database Jpeg images

Posted on 1998-10-18
3
260 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
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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

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…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

809 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