by aspence » July 18th, 2004, 9:23 am
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