ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Detect m/wheel change on TImageEnView 2 load image

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
AdrianKnowles Posted - Oct 29 2019 : 00:06:35
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
2   L A T E S T    R E P L I E S    (Newest First)
AdrianKnowles Posted - Nov 03 2019 : 18:40:43
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
xequte Posted - Oct 29 2019 : 00:53:19
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