Solved

read filename from TPicture

Posted on 2003-11-07
3
163 Views
Last Modified: 2010-04-05
hi...

i can't find the way to extract the filename of the associated file of a TPicture...

i assign the file with something like:

img := TPicture.Create;
img.LoadFromFile('the_file');

but i need to extract that filename... how do i do that?

thank u for your answers.
0
Comment
Question by:corsita
3 Comments
 
LVL 12

Accepted Solution

by:
andrewjb earned 50 total points
Comment Utility
A TImage doesn't remember where it loaded from. You'll have to store it separately somewhere, or derive a new component from TImage

0
 

Author Comment

by:corsita
Comment Utility
really? ... that's weird...

ok thanks for that!
0
 
LVL 5

Expert Comment

by:Hypoviax
Comment Utility
How about when you load the file you save the file path to a variable named something like:

            picfilename

...as a string of course

Then when you want the filename simply refer to this variable.

Regards,

Hypoviax
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

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…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
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…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

743 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

18 Experts available now in Live!

Get 1:1 Help Now