‎07-06-2006 03:10 PM
‎07-07-2006 01:43 AM
I'm not exactly sure of what do you mean with this, but if you are trying to let the user click on a picture and act as if he had pressed a button when on a particular area you can intercept LEFT_CLICK event in the picture control callback and use eventData parameters that on mouse events contains cursor coordinates. Using ConvertMouseCoordinates permits you to translate panel coordinates to picture coordinates, so you can easily detect if the cursor is in a particular area of your picture regardless of its position on the panel.
// Convert panel coordinates to picture coordinates
ConvertMouseCoordinates (panel, control, 1, 0, &eventData2, &eventData1);
// Display them on indicators on the panel
SetCtrlVal (panel, PANEL_x, eventData2);
SetCtrlVal (panel, PANEL_y, eventData1);
Another solution could be to cut out some little portion of the picture and use them in a picture button placed on top of the picture: this way you could use standard button callback without need to struggle with mouse coordinates and button frame could guide the user on where to click on the picture to operate on it.
‎07-07-2006 09:21 AM
‎07-07-2006 02:34 PM
Good afternoon,
The suggestions above are great. The cutting of the picture would be done in some picture editor (not in CVI). Create a smaller image containing a portion of your original image, and put inside of a picture button. Superimpose that picture button so that you can’t tell that it’s not the original and generate a callback for the picture button. When the user presses on that portion of the picture it will fire and event for the picture button. The limitation of this is that the portions of pictures used will need to be rectangular and so if your product is curvy you will have to choose between making the image too small or too large….
Hope this helps-
‎07-10-2006 06:14 PM
‎07-11-2006 03:52 PM
Hello,
I assume that you want to generate these objects at design time since all CVI code must be compiled before running. At design time, you can sort of get the functionality you want by placing a picture down, and placing a transparent-colored command button on top. Make sure that you specify the z-plane order of the objects such that the transparent button is on top. The button will catch the events – I think this will actually accomplish what you are asking, try it out and let me know how it goes 🙂
Thanks for posting -
‎07-13-2006 03:50 PM
Hi!
tell me if I'm wrong, I think another process to check for events is having a timer and then verified into cycle if I press the mouse but my problem is at the time that I know where a press the mouse How can a select an area between two times that the mouse was pressed, as in paint for windows, I know that it is difficult since CVI is not a draw editor but I think that there's is some way to do a little work to generate something like this. Do you if there's any sample that I can use that can have a similar behavior.
Thanks for your help!!!
‎07-14-2006 01:55 AM