PDA

View Full Version : Change cursor when over ICImagingControl



rgralak
November 14, 2005, 23:57:09
In our .Net application we would like to change the cursor from its default to a crosshair when the mouse is over the control. I have changed the cursor property in the control and also at run time with no effect. So, does anyone know a way to change the cursor?

Thanks,

-Ray

Stefan Geissler
November 16, 2005, 12:35:03
Hello Ray,

i wrote a small DLL, that changes the mouse cursor. It searches for the windows of IC Imaging Control and changes the cursor.

You can use it in C# as follows:

Add


using System.Runtime.InteropServices;

To your class add:

[DllImport ("icsetcursor.dll")]
private extern static long FindICWindow(IntPtr ParentWindow, String CursorName);

In the load method of your class add the line:

FindICWindow( this.Handle ,"cross.cur");

"cross.cur" is a cursor file, that will be loaded by the FindICWindow function. Also call this function, after "LiveStart()" has been called, because a new windows is created for the live display.
If the video renderer uses an overlay in the graphics board for drawing, then the new cursor will not be displayed on the live video. If the hardware acceleration of the graphics board is disabled, then the cursor will be shown on the live video. Whether the new cursor is displayed or not, depends on the used graphics board. The DLL and the cursor are in the attached zip file.

The DLL and the cursor should reside in your applications directory.