Author |
Topic  |
|
klausdoege
  
Germany
389 Posts |
Posted - Sep 18 2013 : 05:41:28
|
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
|
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 |
 |
|
xequte
    
39076 Posts |
|
klausdoege
  
Germany
389 Posts |
Posted - Sep 19 2013 : 00:52:36
|
Hello Nigel,
thanks for information, this help me, i will try it.
Klaus www.klausdoege.de |
 |
|
|
Topic  |
|
|
|