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
 OpenImageEnDialog1.Execute and the filter setting
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

Piet

South Africa
3 Posts

Posted - Aug 07 2013 :  22:55:27  Show Profile  Reply
Hello
I use this code:
if OpenImageEnDialog1.Execute then ImageEnView1.IO.LoadFromFile(OpenImageEnDialog1.FileName) else exit;
Problem:
No matter what I do to the filter settings, the dialog opens with jpg only.

This method opens with the common graphics as a filter and is therefore good:
with ImageEnView1.IO do LoadFromFile(ExecuteOpenDialog('','',true,0,'') );
Problem:
I cannot, or do not know how to apply the "if..then..else exit;

Any help on forcing the filter or applying the i-then statement?
Thanks
Piet

Piet Henning
www.pHenning.co.za

xequte

39067 Posts

Posted - Aug 08 2013 :  03:56:51  Show Profile  Reply
Hi Piet

Is TOpenImageEnDialog.AutoSetFilter set to true?

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


If you click the down button on the file type box, what is exactly is listed?

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

Piet

South Africa
3 Posts

Posted - Aug 08 2013 :  09:22:57  Show Profile  Reply
Hello Nigel,
I had it true, then false. I have have set the DefaultFilter to 0, to 1, to -1. Nothing changes.
I have set the FilterIndex to 0, 1, and -1. Nothing changes.

If I click the dropbox, the filters are listed exactly as they are in the filter edit edit feature.


Piet Henning
www.pHenning.co.za
Go to Top of Page

xequte

39067 Posts

Posted - Aug 08 2013 :  18:33:04  Show Profile  Reply
Sorry I may have misunderstood you, are you saying that you have a complete filter (File of Type has all the various types), but it defaults to JPEG?

To have it default to all common image types set FilterDefault to -1 (= no selected type) and FilterIndex to 1 (first item is selected).

You can also use TImageEnIO.ExecuteOpenDialog as follows:

sFilename := ImageEnView1.IO.ExecuteOpenDialog('', '', false);
if sFilename <> '' then
  ImageEnView1.IO.LoadFromFile(sFilename);


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

Piet

South Africa
3 Posts

Posted - Aug 08 2013 :  19:43:11  Show Profile  Reply
Thanks Nigel,
the combination AutoSetfilter=false, Filterdefault=-1 and FilterIndex=1 did the trick.

Piet Henning
www.pHenning.co.za
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: