ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 TSaveImageEnDialog: iesfImagesOnly defaulting to PNG?
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

PeterPanino

933 Posts

Posted - Nov 07 2024 :  02:40:50  Show Profile  Reply
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?

xequte

38607 Posts

Posted - Nov 07 2024 :  16:29:12  Show Profile  Reply
Hi Peter

Please use:

SaveImageEnDialog1.FilterDefault := ioPNG;

http://www.imageen.com/help/TOpenImageEnDialog.FilterDefault.html

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

PeterPanino

933 Posts

Posted - Nov 08 2024 :  07:39:07  Show Profile  Reply
Hi Nigel

Thanks, now it works as intended.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: