Board index » cppbuilder » OnMouseWheel over TImage

OnMouseWheel over TImage


2004-05-18 03:09:15 AM
cppbuilder43
Hi all,
anybody already experienced on add an OnMouseWheel event handler on a
TImage?
Or, what I should do to add it?
Thanks in advance.
Lapo
 
 

Re:OnMouseWheel over TImage

"Lapo Guidi" < XXXX@XXXXX.COM >wrote in message
Quote
anybody already experienced on add an
OnMouseWheel event handler on a TImage?
Or, what I should do to add it?
The OnMouseWheel... events depend on the CM_MOUSEWHEEL message, which in
turn depends on the WM_MOUSEWHEEL message being sent by the OS to a
control's window. TImage derives from TGraphicControl and as such does not
have a window of its own with which to receive OS messages directly. The
VCL has to dispatch the messages manually from the graphic control's Parent.
Why do you need mouse wheel events on a TImage? What exactly are you trying
to accomplish?
Gambit
 

Re:OnMouseWheel over TImage

Hi Gambit,
Quote
The OnMouseWheel... events depend on the CM_MOUSEWHEEL message, which in
turn depends on the WM_MOUSEWHEEL message being sent by the OS to a
control's window. TImage derives from TGraphicControl and as such does
not
have a window of its own with which to receive OS messages directly. The
VCL has to dispatch the messages manually from the graphic control's
Parent.
Thanks for the explanation.
Quote
Why do you need mouse wheel events on a TImage? What exactly are you
trying
to accomplish?
I have a network camera that is sending images to a TImage descendant.
This camera can move over the three axis X, Y and ZOOM.
Now I used OnMouseDown to centre the image.
The last goal would be Zoom-In if the Mouse Wheel is rolled up, otherwise
Zoom-Out.
I know how to Zoom in or out but I need user input.
Thanks for your answer.
Lapo
 

{smallsort}

Re:OnMouseWheel over TImage

"Lapo Guidi" < XXXX@XXXXX.COM >wrote in message
Quote
I have a network camera that is sending images to a
TImage descendant. This camera can move over the
three axis X, Y and ZOOM. Now I used OnMouseDown
to centre the image. The last goal would be Zoom-In if
the Mouse Wheel is rolled up, otherwise Zoom-Out.
TImage itself can't receive mouse wheel notifications directly. However,
the parent TForm will receive any notifications while the mouse is over the
TImage. So you could just use the form's OnMouseWheelUpDown events, then
check if the mouse is currently positioned over the TImage, and if so then
update your camera as needed.
Quote
I know how to Zoom in or out but I need user input.
If the above doesn't work, you could always just provide a separate
TTrackBar for doing that. Or a pair of TButton that start a timer when held
down and stop the timer when released.
Gambit
 

Re:OnMouseWheel over TImage

Thanks very much for your help, I have it working now.
Lapo