DELPHI AREA
MESSAGE BOARD
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How get the current File name of a TImage?

 
   Reply to topic    DELPHI AREA Forum Index -> Delphi Programming
View previous topic :: View next topic  
Author Message
hadipardis
Member


Joined: 17 Jul 2004
Posts: 11

PostPosted: 18/07/04 08:12    Post subject: How get the current File name of a TImage? Reply with quote

Hi
I have a TImage which contains a picture.This picture was loaded from a file.Now I want to return the file name or exactly
the path name of it.Can you help me?
Thanks
cheers
Back to top
View user's profile
aspence
Member


Joined: 11 Jul 2004
Posts: 13
Location: Wolfville, N.S. Canada

PostPosted: 18/07/04 09:23    Post subject: Reply with quote

Usually, a picture is assigned to a TImage at design time. When you do this, the 'load image' dialog is used to select an image from some drive location. At this point, the image is loaded and the data is stored directly in the forms dfm. No path to the image is stored anywhere. Once the image has been loaded, you could actually delete the original from the drive. There are two alternatives:

The first is certainly the most extreme. You could subclass TImage and add a property that holds a path (string). Then you could subclass the property editor for loading images (TPictureEditorDlg in PicEdit.pas). You could presumably modify this editor to pass the path info on to your new subclassed TImage. Yikes!

Secondly. You could assign the picture to a TImage programattically by calling TPicture.LoadFromFile and storing that path somewhere for later reference.

_________________
- Arnold B. Spence
Back to top
View user's profile
Display posts from previous:   
   Reply to topic    DELPHI AREA Forum Index -> Delphi Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB 2.0.6 © 2001, 2002 phpBB Group