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
 SaveImageEnDialog
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

klausdoege

Germany
389 Posts

Posted - Sep 18 2013 :  05:41:28  Show Profile  Reply
Hello,

when i use:
SaveImageEnDialog1.FilterIndex:=5; // *.bmp
SaveImageEnDialog1.FileName:='';
if SaveImageEnDialog1.Execute then ;
Then all is OK, Filter is *.bmp.

when i use:
SaveImageEnDialog1.FilterIndex:=5; // *.bmp
SaveImageEnDialog1.FileName:='TestScan';
if SaveImageEnDialog1.Execute then ;
Then the Filter is *.jpg.

That is badly if I scan many pictures, and as BMP would like to store.
And the name consecutive is, for example: Scan1.bmp, scan2.bmp,...
Why does Filterindex have no priority here?

Klaus
www.klausdoege.de

w2m

USA
1990 Posts

Posted - Sep 18 2013 :  08:50:59  Show Profile  Reply
I think if you want bitmaps then add the extension to the filename. I think the filename and extension takes priority over the filter.
FilterIndex specifies what file format to select by default.
From the Help File:
The InitialFileName extension, if specified, in the second parameter, will over-ride the specified index.

If you change the filter in the dialog then the extension of the filename will change to match the filter. But if you change the extension of the filename the filter does not change to match the extension.

So it is best to use a full filename with extension:
SaveImageEnDialog1.FileName:='TestScan.bmp'; When you do this you ensure the file will always be a bitmap.

Personally, I like to use the SavePictureDialog and also use IERegisterFormats to register the imageen supported file types with TPicture. That way you get a modern dialog that matches the operating system. With the SavePictureDialog you can also set the Default extension, so if someone does not add an extension to the filename, the file will be saved with the specified default extension.

William Miller
Adirondack Software & Graphics
Email: w2m@frontiernet.net
EBook: http://www.imageen.com/ebook/
Apprehend: http://www.frontiernet.net/~w2m/index.html
Go to Top of Page

xequte

39076 Posts

Posted - Sep 18 2013 :  12:44:52  Show Profile  Reply
Hi

It is better to use FilterDefault than FilterIndex:

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


SaveImageEnDialog1.FilterDefault := ioBmp;
SaveImageEnDialog1.FileName:='';
if SaveImageEnDialog1.Execute then...

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

klausdoege

Germany
389 Posts

Posted - Sep 19 2013 :  00:52:36  Show Profile  Reply
Hello Nigel,

thanks for information,
this help me, i will try it.

Klaus
www.klausdoege.de
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: