LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Picture

I am displaying a picture on the front panel of my program and want to align it with a particular pixel co-ordinate each time the program is run. I haven't been able to do this despite playing around with property nodes and origins etc. Any help would be greatly appreciated.
thanks
0 Kudos
Message 1 of 9
(3,546 Views)
The origin property is specific to the picture control (that's why it's all the way down in the list) and it determines the origin of the picture. To set the position of the control you need to use the Position (Left and Top) properties which can be found at the top of the list.

___________________
Try to take over the world!
0 Kudos
Message 2 of 9
(3,519 Views)
Thanks for the quick reply - but i have played with the position thingy and it seems to be using a funny grid system - ie. 0, 0 isn't the top left hand corner of the screen it's the top left hand corner of the VI box display - one of my programs which I instructed to make the position 0, 0 put the picture off the screen and would only put it back on the screen when it had co-ordinates around -700, -300. I've also played around with the origin control but can't seem to get it to do anything. Sorry - as you can probably tell I'm a new user!!
0 Kudos
Message 3 of 9
(3,516 Views)

The point (0,0) is marked on your FP by a diamond which is the intersection of two thicker lines. You probably created FP element to the left and top of it, thus putting them in the negative area. I always set up my FPs so that point is at the top left corner (that's the origin). You can move your elements so they will be at the "right" place or you can change the numbers you're wiring into the position property based on what you're reading from the FP.Origin property.

To learn more about LabVIEW, I suggest you try searching this site and google for LabVIEW tutorials. Here and here are a couple you can start with and here are some tutorial videos. You can also contact your local NI office and join one of their courses.
In addition, I suggest you read the LabVIEW style guide and the LabVIEW user manual (Help>>Search the LabVIEW Bookshelf).


___________________
Try to take over the world!
0 Kudos
Message 4 of 9
(3,509 Views)
Is it possible to place objects on the front panel using pixels as the co-ordinates rather than the grid thing?? This is what I really need to do - using the grid thing will be too difficult.
0 Kudos
Message 5 of 9
(3,487 Views)
You may also want to look into the "Front panel origin" and "Front panel bounds" properties of the vi itself. You can access these properties by using the "open vi reference" function. I believe the panel origin is the location of the (0,0) relative to the corner of the vi window. Front panel bounds will tell you where your vi is on the screen. I attached a little example that links these properties (and some others).
0 Kudos
Message 6 of 9
(3,492 Views)
yeah but the 0, 0 is relative to the VI when it was first created, not the computer screen itself - on the computer screen 0, 0 is always in the top left hand corner and doesn't vary - this is what I want to use - that is putting things on the front panel with pixels not the grid - is there a way to do this??
0 Kudos
Message 7 of 9
(3,471 Views)
To define the position of a control relative to the screen (0,0) then do this: (FP. Origin) - (FP. WinBounds Left, Top) + (desired offset). I will try to attach a vi that demonstrates this.
0 Kudos
Message 8 of 9
(3,466 Views)
I can't look at the posted VI, but in general, I would advise against using "real" pixel coordinates, unless you're doing something like interacting with OS functions which require them, as you can't know where your window will be and this will be affected by things like how wide the border of your window is and whether you're showing the menu and tool bars and so on. Instead, just make sure that the 0,0 point is at the top left corner of your screen and then you will know exactly where each element each without needing to do any conversions. You can forcefully do this by writing to the FP.Origin property (BTW, when it's the current VI (or application) you don't need to open a reference). Look at the attached VI to see how it isn't affected.

___________________
Try to take over the world!
0 Kudos
Message 9 of 9
(3,454 Views)