October 28th, 2012, 01:52 PM
Problem when canceling OpenPictureDialog
I have this problem.
When I open "OpenPictureDialog" and click Cancel Button i get this message UNKNOWN PICTURE FILE EXTENSION (.)
October 28th, 2012, 11:34 PM
Without posting the code that causes the error, at best we can only guess as to what is happening.
Given that, my guess is that you are not "Executing" the dialog correctly.
if OpenPictureDialog.Execute then
//the file selected will be in
//only do the "loadfromfile" if the dialog is executed
//otherwise the user clicked cancel
October 29th, 2012, 12:53 AM
Originally Posted by majlumbo
Sorry about code.
here it is
October 29th, 2012, 08:04 AM
You need to test to see if the user actually executed the dialog box (hits the ok button, vs. the cancel button.
procedure TFMain.ChooseClick(Sender: TObject);
sDir : string;
if OpenPictureDialog1.Execute then
sDir := OpenPictureDialog1.FileName;
October 29th, 2012, 02:46 PM