LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Set the background image of a cluster? [LV 2013]

Solved!
Go to solution

Hello -

 

Researcher says, "Why don''t you put the image on the front panel and then decorate the image with controls? See? Problem solved." And the door closes.

 

So I take the image, get it scaled properly, and voila! it's now the background image.  Then add controls.

 

The horizontal and vertical scroll bars move the controls... but the background image doesn't track.  So if someone touches the scroll bars (they are needed) then controls and image don't line up.  Worse, getting them realigned manually is a pain in the hand-eye control.

 

I could put in a button labeled "Realign" and have it reset the scroll bar position. Or have the VI monitor scroll bar position (look at the FP zero spot) and some image processing to shift the image.  That does sound painful.  Is there another way around the problem?

 

Hm. A cluster? Clusters track the scroll bars. But I can't seem to put an image into a cluster's background. The background color can be changed... but I don't see a way to paste an image.  I did try customizing the cluster control and attempted to use the same method for adding an image there than as on the front panel (right-click the scroll bar, follow the prompts). That changed the background of the typedef'd control.  Saved it.  Tried to use it. LabVIEW goes >BEEP<  and nothing appears.

 

I'd really like to avoid building this complex image out of decorations.  Especially when the image has chemical compounds in boxes: how to do subscript and superscript letters and numbers?   That.. and the image is one of those "it's in refinement.." stages.

 

Thank you for your time.

 

 

Mark

0 Kudos
Message 1 of 11
(4,758 Views)

I would try to avoid using a scrollable cluster with your controls. Also usually good to avoid TABs as well. When I do not have enough surface for controls, I try to use pop-up windows for settings for example. It is in general good to have a non overcrowded GUI with too many controls, try to group them, and only show the user the really necessary things by default, everything else in settings menu, etc...

I have never used, but people do cool things using subpanels too...

So as you see, I do not have a real solution for your problem, but sometimes a bit planning/re-thinking for the GUI can make things easier...

0 Kudos
Message 2 of 11
(4,735 Views)
Solution
Accepted by topic author Tinkerer

You don't give enough info on how this actually looks, and I don't have experience with background images, but I would suggest you simply drag the image file into the FP and use the reorder menu in the toolbar to move it to the back (Ctrl+Shift+J) and it should then maintain position relative to the other objects. You can then use the same menu to lock it, so that it's not moved accidentally. You can also place a picture control in the back and load the image in code if it changes a lot, but that's not a recipe for positioning elements correctly.

 

I also generally agree with Blokk that scrolling is a flag. If you need to scroll, you should look and see if there's a problem and other solutions.


___________________
Try to take over the world!
0 Kudos
Message 3 of 11
(4,688 Views)

The horizontal and vertical scroll bars move the controls... but the background image doesn't track.

 

When select the background image, set the Position to either Stretch or Tile, instead of Center.

 

Untitled.png

 

 

George Zou
0 Kudos
Message 4 of 11
(4,675 Views)

A scrollable ..cluster.. ?

 

If I place a cluster somewhere on a panel, I would expect the scroll bars to shift the cluster the same way scroll bars shift the contents of a block panel.

 

I can't count the number of times I've put little arrows at screen bottom and shifted the front panel left/right/up/down to expose controls.  Pop-ups are pretty... but means a bunch extra work to pass stuff in/pass stuff out and get it all wired up.

 

The problem here is a large graphic (1264 x 711) and my display at 1280 x 1024.  It is very likely that the scroll bars are going to be tweaked... and that throws off the alignment between any positioned controls and what I'm now thinking is a "wallpaper" effect.

 

If a cluster could hold the wallpaper then putting controls into the cluster would associate the controls with the cluster and that would be fine.

 

0 Kudos
Message 5 of 11
(4,630 Views)

That was tried.  First placed the image, set Center, back to the front panel, started placing controls... and nudged the scroll bars.

 

The controls tracked the scroll bars.  The image stayed put.

 

On my pane properties panel, the Stretch/Center/Tile is at the right.  Perhaps we're using different versions of LV ?

 

0 Kudos
Message 6 of 11
(4,623 Views)

This ... WORKS!  I did not know a graphic could be place on a block diagram like that.

 

Is there a way to recolor the cluster border?  I'd like to remove that box.

 

0 Kudos
Message 7 of 11
(4,615 Views)

@Tinkerer wrote:

This ... WORKS!  I did not know a graphic could be place on a block diagram like that.

 

Is there a way to recolor the cluster border?  I'd like to remove that box.


First, without any clear indications it's hard to tell which post you're replying to. From context, I'm assuming it's mine. There's a quote button in the editor and I suggest you use it when relevant.

 

As for the cluster border, you can right click it with the coloring tool and then use the space bar to toggle the color selector to switch between foreground and background colors (there's a line of text in the bottom of the popup indicating this, which is useful to remember). When you do that, you can make the border transparent.

 

This still sounds like a problematic design, but it's your program. If you want more help, I would suggesting uploading actual code people can relate to.


___________________
Try to take over the world!
0 Kudos
Message 8 of 11
(4,605 Views)

Hm.  For each responder, I had left-clicked on the Reply beneath their post, thinking that would reply to the specific post.  Apparently not.

 

Dropping the image onto the background, sending it to the "back", then placing controls "in front" seems to work.  Grouping the whole thing together allows moving the whole collection around and keep controls placed properly on the image.

 

No code was involved; just getting controls placed properly onto a JPEG diagram... without having to draw the image.

 

But I have run into a GUI/programming problem ... but that's a matter for another post.

0 Kudos
Message 9 of 11
(4,488 Views)

can someone please tell how to change background images in clusters?

0 Kudos
Message 10 of 11
(3,393 Views)