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
 Detect m/wheel change on TImageEnView 2 load image
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

AdrianKnowles

USA
35 Posts

Posted - Oct 29 2019 :  00:06:35  Show Profile  Reply
Hi,
I'm running into a problem, which is probably quite simple but
I cant figure out how to overcome it.

On a non-visible/hidden tab I have a TImageEnMview containing several images.
On a visible tab I have a TImageEnView.

When the mouse cursor is over the TImageEnView I'd like to have an event occur that when I move the mousewheel up/down it then loads the previous/next image from the TImageEnMview.

If I have the mouse cursor over the TImageEnMview and the mousewheel action for that set to navigate then I can, with a couple of lines of code, load the relevant image into the TImageEnView as the mouse wheel moves up and down.

However I don't see a way I can do that when the mouse cursor is over the TImageEnView. I've looked at the options in mousewheelparams but to no avail.

Is there something I am missing?

Kind regards,
Adrian

xequte

38180 Posts

Posted - Oct 29 2019 :  00:53:19  Show Profile  Reply
Sorry, I may not be following. Can't you just do:

procedure TMainForm.ImageEnView1MouseWheel(Sender: TObject; Shift: TShiftState;
    WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean);
begin
  if WheelDelta < 0 then
    fCurrentImage := max( 0, fCurrentImage - 1 )
  else
    fCurrentImage := min( ImageEnMView1.ImageCount - 1, fCurrentImage - 1 );

  ImageEnMView1.CopyToIEBitmap( fCurrentImage, ImageEnView1.IEBitmap );
  ImageEnView1.Update;
end;


Ensure you set ImageEnView1.MouseWheelParams.Action := iemwNone;


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

AdrianKnowles

USA
35 Posts

Posted - Nov 03 2019 :  18:40:43  Show Profile  Reply
Many thanks for the advice, I adapted our approach and it works a treat


if WheelDelta <= 0 then
    begin
      ImageEnFolderMView1.SelectedImage:= ImageEnFolderMView1.SelectedImage-1;
    end
  else
    begin
      ImageEnFolderMView1.SelectedImage:= ImageEnFolderMView1.SelectedImage+1;
    end;
  ImageEnView1.IO.LoadFromFile(ImageEnFolderMView1.SelectedFilename);

Thanks again,
Adrian
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: