12-08-2011 06:39 AM
Allen,
I think that could work with a LV Picture Control. I've found some forum posts with examples that might be useful. Using an LV Picture Control will solve the issue of porting to Red Hat too.
'Ed Dickins' has an example in this thread of how to move JPGs around.
TST has an example of dragging a picture here.
Post #11 here has an example of rotating picture.
Here is a post on how to transition between images - useful for zooming in you application.
I hope that helps. Let me know how you get on and what other functions you'll need to implement.
Regards,
12-08-2011 06:45 AM
Hi Oli,
Thanks for those pointers to applications - I'll have a look at them and hopefully, there will be a good solution!
I really appreciate you help,
Best wishes,
Allen
12-08-2011 06:47 AM
Hi Oli,
I've just noticed that all those applications relate to LabView .....
We're only using CVI!!!
Any similar samples in CVI?
Thanks,
Allen
12-08-2011 06:50 AM
Hi,
Sorry about that. I'd forgotten.
CVI complicates things. I'll have a look to see what I can find.
Regards,
12-09-2011 05:24 AM
Hi Allen,
It looks like the best thing to use to implement this in CVI is a 'Canvas Control'. I've found a few links that might be useful. I've never used a canvas control before, so I can't suggest anything specific to try.
How to program a two layers picture?
Looking for a picture control for CVI that is zoomable
How to control image file (jpg, bmp)
I also did a search for 'Canvas Control' in the CVI forums, which had a lot of results. Rather than post them here, perhaps you could take a look?
Hope that's of some use
Regards,
12-09-2011 05:40 AM
Good morning Oli,
Many thanks - and yes, I have been looking at using the canvas control, it certainly appears to have all the facilities that are required.
It will be a weekend of coding - and I'll let you know how we get on.
Many thanks for your help,
Allen
12-20-2011 06:36 AM
Hi,
I tried the canvas control, but am having more success with using a graph as the basis for the map.
However, there are two aspects with which I would appreciate some guidance:
1) The graph control in the UIR allows for various types of 'Zoom' - zoom around a point, zoom to a rectangle, zoom on x-axis or zoom on y-axis. The attribute to disable the zoom functionality states 'Zooming/Panning Disabled', and the 'SetCtrlAttribute' control also states 'ATTR_ENABLE_ZOOM_AND_PAN'
I can make the map 'Zoom', but where and how is the 'PAN' aspect implemented?
2) When using the 'Zoom around a point' aspect, the 'CTRL' key has to be held down whilst left-clicking the mouse.
How can I 'catch' this event? Using the standard EVENT_LEFT_CLICK responds to the first left-click of the mouse with the CTRL key held down, but the event does not respond to subsequent 'clicks', unless the 'CTRL' key is released and re-pressed for the next left-click.
Many thanks for any advice,
Allen
12-20-2011 06:45 AM
Hi,
concerning the second aspect, you could consider GetGlobalMouseState (NULL,NULL,NULL,NULL,NULL,&key_modifiers);
With respect to your first question of panning, press <Ctrl-Shift> and click and hold the left mouse button.
Wolfgang
12-20-2011 06:55 AM
Hi Wolfgang,
Many thanks - you have answered both of my questions!
Bset wishes,
Allen
12-20-2011 07:00 AM
pleased to hear - my pleasure!