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
 How to do mouse right to scroll

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
Waheed Posted - Aug 09 2021 : 23:25:57
I would like to imitate IrfanView left mouse to select, right mouse to scroll when zoomed in.
How can I do that? Select is easy, the problem is with right mouse to scroll.

-----------------
3 Monitors
Windows 10
Delphi 6,2007 and 10.2
ImageEn v.10.0.1
5   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Aug 11 2021 : 22:27:31
Yes, that looks good.

Nigel
Xequte Software
www.imageen.com
Waheed Posted - Aug 11 2021 : 02:32:40
So, in the form private I declared:

fScrolling : boolean;
fMouseDownX, fMouseDownY, fOrigViewX, fOrigViewY: Integer;


In OnMouseDown :
if (Button = mbRight) then begin
      fScrolling  := True;
      fMouseDownX := X;
      fMouseDownY := Y;
      fOrigViewX  := ImageEnView1.ViewX;
      fOrigViewY  := ImageEnView1.ViewY;
   end;


That solved it.

Thanks
xequte Posted - Aug 11 2021 : 00:33:05
Hi

You should be able to just put that code in the mouse events of a TImageEnView on your form.

Nigel
Xequte Software
www.imageen.com
Waheed Posted - Aug 10 2021 : 22:05:44
Does this mean I have to create a component based on TImageEnView and add these events to it? This doesn't cover Right mouse click.

A Demo is much more appreciated.

-----------------
3 Monitors
Windows 10
Delphi 6,2007 and 10.2
ImageEn v.10.0.1
xequte Posted - Aug 10 2021 : 18:17:37
Hi Waheed

It would be something like:

In MouseDown set private fields

fScrolling  := Button = mbRight;
fMouseDownX := X;
fMouseDownY := Y;
fOrigViewX  := ImageEnView1.ViewX;
fOrigViewY  := ImageEnView1.ViewY;


In MouseMove:

if fScrolling then
  ImageEnView1.SetViewXY( fOrigViewX - trunc((X - fMouseDownX) * ImageEnView1.MouseScrollRate ), 
                          fOrigViewY - trunc((Y - fMouseDownY) * ImageEnView1.MouseScrollRate ));


In MouseUp:

fScrolling := False;


Nigel
Xequte Software
www.imageen.com