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
 problem with MouseWheelParams.Action:=iemwZoom
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

jrpcguru

USA
273 Posts

Posted - Feb 18 2013 :  17:13:15  Show Profile  Reply
I have just begun using ImageEn and like it so far. But I've found a puzzling problem:

I use the following code to load an image:
sFileName := OpenImageEnDialog1.FileName;
ImageEnView1.IO.LoadFromFile(sFileName);
After which I receive the default result from the mouse wheel of zooming the image.

If I then load another file using the same code, the mouse wheel no longer does anything. I've tried everything I could find on the web, the help file, and the eBook to force it to behave, but it simply ignores ImageEnView1.MouseWheelParams.Action:=iemwZoom;

I'm using Delphi XE2 and Win7 Pro.

The only thing I've found which restores the mousewheel zoom is acquiring an image from my scanner. But it is lost again as soon as I use LoadFromFile.


J.R.

fab

1310 Posts

Posted - Feb 20 2013 :  15:02:06  Show Profile  Reply
I cannot replicate. Perhaps ImageEnView has lost focus?
Please try:

ImageEnView1.SetFocus();

...just after OpenImageEnDialgo1.Execute() returns.
Go to Top of Page

jrpcguru

USA
273 Posts

Posted - Feb 21 2013 :  09:34:45  Show Profile  Reply
if OpenImageEnDialog1.Execute then
    begin
      ImageEnview1.SetFocus();
      ImageFileName := OpenImageEnDialog1.FileName;
      ImageEnView1.IO.LoadFromFile(ImageFileName);
//showmessage('just loaded');

      ImageEnView1.setfocus;
    end;


I had already tried setting focus after loading. I've now tried setting focus before as you suggested, but no change. One thing I forgot to mention in my original question: If I use a showmessage() after loading, I don't lose the scroll wheel for zooming. That usually suggests a timing issue so I tried up to a 2 second pause which didn't work.

J.R.
Go to Top of Page

fab

1310 Posts

Posted - Feb 27 2013 :  01:51:46  Show Profile  Reply
I'm sorry, I still cannot replicate. Please send a sample application.
I put a TImageEnView and a button on the form, then handled button click with:

  ImageEnView1.MouseWheelParams.Action := iemwZoom;
  if OpenImageEnDialog1.Execute then
    begin
      ImageEnView1.IO.LoadFromFile(OpenImageEnDialog1.FileName);
      ImageEnView1.setfocus;
    end;


It works, tested on Delphi XE2 and Win 7.
Go to Top of Page

jrpcguru

USA
273 Posts

Posted - Feb 28 2013 :  08:56:45  Show Profile  Reply
I can confirm that a simple program such as you suggest does work correctly. That leaves me wondering what weird conflicts exist in my program. But I gave up and moved on. I was able to create the desired zoom via mousewheel by using the MouseWheel event, so I did not lose by giving up.
Thanks for the reply.

J.R.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: