I’m just starting to develop the Winforms GUI for a C# application and was wondering if the following was possible?
I wish to display a large image in a Picture Box (easily done) and then have a second smaller image overlay onto the large image at the mouse position, when the mouse pointer is over the larger image. If possible I would like the overlay image to be partially transparent.
As the GUI design is at an early stage I can change it to WPF if this would make what I’m asking any easier.
Many thanks,
Andy.
That’s a one-liner in Winforms, just change the PictureBox.Cursor property:
If you need an arbitrary image then you need to convert the bitmap to a cursor. A little helper function to do it:
With some reflection trickery to avoid having to keep track of the handle and destroy it explicitly. Use it like this: