My SaveImageEnDialog correctly shows all image formats, but unfortunately, it always defaults to the SVG format (while I want it to default to the PNG format):
procedure TForm1.mSaveImageClick(Sender: TObject);
var
SaveImageEnDialog1: ieopensavedlg.TSaveImageEnDialog;
begin
// Create the dialog at runtime
SaveImageEnDialog1 := TSaveImageEnDialog.Create(nil);
try
// Todo: display all image formats in the TSaveImageEnDialog with iesfImagesOnly, defaulting to PNG:
SaveImageEnDialog1.ShowFormats := iesfImagesOnly; // this does work
//SaveImageEnDialog1.DefaultExt := 'png'; // this does not work
// Attach the dialog to the ImageEnView's IO component:
SaveImageEnDialog1.AttachedImageEnIO := ImageEnView1.IO;
// Execute the dialog
if SaveImageEnDialog1.Execute() then
ImageEnView1.IO.SaveToFile(SaveImageEnDialog1.Filename);
finally
// Free the dialog to prevent memory leaks
SaveImageEnDialog1.Free;
end;
end;
How can I make it default to the PNG format?