02-26-2009 04:40 AM
Sonali wrote:If I want to rotate one more control over it (obviously Train), how to do it?
You can use a Picture ring to do a motion picture kind of thing.
See the attached VI.
02-26-2009 04:54 AM
Yes its moving but in my application if the main pict control contain 1 Km track and I want 2 Km long track, then I need to drag the track ( image inside the pict control) twice anywhere* in FP to make it 2 Km. Is it possible?
- thank you
02-26-2009 05:40 AM
02-26-2009 08:11 AM
In reply #12 of this thread I posted a mod of Ton's example that let you drop an image when you click on a Picture control.
THis thread has a collection of links to posting with Picture examples.
Post #33 of this thread has an example I posted where I determine which object in a picture control was clicked.
Comment:
Application that involve the Picture control are seldom trivial.
Ben
02-26-2009 11:36 PM
Thanks all,
If I use Large Picture Control( in attach file) How to drag the Ring control image anywhere on pict control. I'm new for LabVIEW, I want to know if it is possible, so that I can use it in future application.
- Thanks.
02-27-2009 12:42 AM
Sonali,
Everything, almost everything except creating the GOD, is possible in LabVIEW.
But, you need to dig deeper for this...
I understand that for a beginner, this kind of animation/motion picture project is a too much (t)ask, but you have to live with it.
If you read & study Ben's post about using the LV Picture Control totally, then I m sure that you can jumpstart your task somewhat with ease.
Try it out & post here back...
The most important thing in LabVIEW code development:
Always put a small Wait timer inside the while loop. Else it ll spin infinitely & consume all your CPU resource.
02-27-2009 04:41 AM
Thank You parthabe,
I gone through examples of drag n drop and tried to drag the same ring image to pict control but could not get it. I want to ask can I use same control to drop the image from different ring indicators? As of now I used only one ring indicator. Please help me.
- Thank You in advance
02-27-2009 04:54 AM
Sonali,
I have never used the Picture control to a very greater extent. So, I may not be able to give you an example.
But I m pretty sure that we can drop many objects [controls/indicators] into one Picture control in different places inside it, by looking for the non-white spaces in it, which means that there exists already an object in that location.
This is what Ben has suggested in the Picture Control thread, I think...
Anybody please correctc if my understanding is wrong.
02-27-2009 06:14 AM - edited 02-27-2009 06:15 AM
Sonali,
Parthabe gave you good advice.
1) Your example is using a proprty node that is a bug meaning it should not exist for the Pictu ring.
2) PLEASE look at the example I linked that uses Ton's dynamic event example. It pulls the IMAGE (not the data) from the ring and places where ever you click in the picture.
3) To extend that example so you can see the dragging, then you can watch for mouse moves (after they have started the drag). The coordinates of the mouse can then be used to position the ring control (property node >>> position) to have the pict ring follow the mouse.
4) Whn you see Mouse up, grab the image (see example in Ton's thread) hide the pict ring and insert the image in the picture.
So you will have to track mouse down up move etc. There is also some postion translation required to convert screen coordinates to picture but those are "just details".
Have fun, post your code whne you get stuck. Since it is train realted, I may even look at it this week-end.
Ben
PS see post about my LabVIEW controlled model railroad in this thread. Here is a preview (please note LV GUI on Laptop).
02-27-2009 07:10 AM