?
Solved

Database Jpeg images

Posted on 1998-10-18
3
Medium Priority
?
265 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 200 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone 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

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…
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.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses
Course of the Month15 days, 4 hours left to enroll

771 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