M
moss
Hi,
I have a simple custom control (inherits from UserControl) that
displays an image (not a pictureBox). My goal is to get the pixel
coordinates and the RGB values of a pixel that the mouse is hovering
over and display that information in the status bar of my application.
Since this is an image viewing application, the image displayed on the
control is always changing, and there are two viewing modes:
1. the image streches the boundaries of the control (enables
autoscroll if necessary) to fit its contents.
2. if the image size iz bigger than the clientsize of the control, the
image is resized to fit the current size of the control, leaving some
blank space around itself.
So I think you can see my point here... how can I get the pixel
coordinates and values when the mouse hovers the image, not over the
whole control? It seems to me I'll somehow have to always keep on
track of the area on the control containing the image that will handle
the MouseMove event or something like that... Please help if there's
an easier solution.
Marko
I have a simple custom control (inherits from UserControl) that
displays an image (not a pictureBox). My goal is to get the pixel
coordinates and the RGB values of a pixel that the mouse is hovering
over and display that information in the status bar of my application.
Since this is an image viewing application, the image displayed on the
control is always changing, and there are two viewing modes:
1. the image streches the boundaries of the control (enables
autoscroll if necessary) to fit its contents.
2. if the image size iz bigger than the clientsize of the control, the
image is resized to fit the current size of the control, leaving some
blank space around itself.
So I think you can see my point here... how can I get the pixel
coordinates and values when the mouse hovers the image, not over the
whole control? It seems to me I'll somehow have to always keep on
track of the area on the control containing the image that will handle
the MouseMove event or something like that... Please help if there's
an easier solution.
Marko