Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

cursor .net

Hi

I am using IMAQ, Vision and MacineVision in VB.Net2005

Currently my the mouse cursor is a hand with a pointing finger on the viewer.

I want to change the cursor at runtime. I need the hand to be replaced with the standard windows arrow and sometimes change between that and 3 other cursors (a crosshair, a vertical line and a horizontal line).

The idea is to let the user select either a horizontal, vertical or combined point and then save this point for reference.

Thanks in advance for responses.

Bestbier
0 Kudos
Message 1 of 6
(4,334 Views)
Hi bestbier,

Can you provide us with some more information regarding your application?
Are you acquiring from a Camera, and if so, which one?  Which version of NI-Vision and NI-IMAQ do you have installed?  Are you using one of our image capture boards?


You only mention that you want to dynamically change your mouse cursor based on your location within 'the viewer', which viewer are you referring to?  Is it adequate to change your cursor based on static pixel location.  This should easily be possible using .NET.  Look at the following webpage to get some ideas:

http://www.devasp.net/net/articles/display/334.html

Regards,
Rishi L
National Instruments
Applications Engineer
0 Kudos
Message 2 of 6
(4,315 Views)
Hi

I am using a NI PCIe-1427 cameralink grabber with a Kappa Vision X-Ray camera do display 12bit grayscale video. I have NI Vision v8.5 and NI IMAQ v3.8.

I want to change the cursor so that when the mouse moves over the viewer (the NI Vision CWIMAQViewer component) it changes and when the mouse moves off the window it returns back to the standard windows cursur. Currently when the mouse moves onto the viewer the cursor changes to a hand with a pointing finger and returns to normal when it moves off. So what I want to do does currently happen, I just want to control which cursor it changes to.

Best regards
Bestbier
0 Kudos
Message 3 of 6
(4,308 Views)
Bestbier,

Can you send me a screenshot of how the cursor looks when you mouseover the viewer?   Is it same as the pointer for "link select" when you look under Mouse >> Pointers tab in the control panel?

Does your viewer have the same absolute position during every run of the code?  You may be able to simple change the visible cursor using calls to Windows API based on the cursors location in your application.

Rishi L
National Instruments
Applications Engineer
0 Kudos
Message 4 of 6
(4,300 Views)
Hi Rishi

Yes the cursor is like the "Link Select" cursor. All the sample app I have looked at have the standard windows pointer cursor over the viewer window.

My app has a fixed size and the viewer size is also fixed and at location 0,0.

I know you can use Windows API calls to do this, but I have no idea how.

One more thing: Do you you if there are any things I need to know about creating an install for my app. Can I just use the Setup Project Wizard? I have a Vision Run-Time license and a new PCIe-1427 for the computer I need to install it on

Best regards
Bestbier
0 Kudos
Message 5 of 6
(4,297 Views)
Hi Bestbier,

I can't help you in creating an installer with .net as I'm not familiar with it.  I can provide support with using National Instruments functions and functions calls in it, but that is the extent of my knowledge.

Basically, you will need to add the NI-IMAQ drivers to the installer as well as the Visision Run-time so that your PCI card is recognized and so you can use the Vision functions.

Getting your windows cursor to change is a call to the windows API, so you should try to Google some help on it.  I looked at a few sites and I've listed them below.  All you need to do is find out how to change the mouse cursor, and then write a series of if statements to let you know that you are in the bounds of the viewer so that the cursor changes.

An easier way to accomplish this would be to just change the Link Select cursor in your Control Panel (unless you absolutely want to keep the one you have as default).

How to change mouse cursor in VB.Net applications

ASP.net methods that find mouse coordinates

dotnet247.com search results for "change mouse cursor"

Changing the mouse cursor
Rishi L
National Instruments
Applications Engineer
0 Kudos
Message 6 of 6
(4,284 Views)