LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can you customize an Indicator/Control shape?

Hello everyone,

 

This is a question that has puzzled me for a long time. Is it possible to make an indicator/control any shape other than a rectangle? I am well aware of creating custom controls and using .pngs as a method of making controls appear irregular shaped by using transparency, but you can still click on the transparent parts and have it register as a click on the control. I want to be able to define the actual edge of the control as something irregular. My end goal is to fit many of these controls together like a puzzle, and I don't want to be clicking on the wrong piece because the transparent corners of one control overlap the other.

 

I put together an extreme example to illustrate my point.

The image below shows the border of a custom indicator:

21393i830D22FE4A0B8FF1

 

If I put a blue indicator of the same type next to it you will see that the transparent border of the red shape blocks the blue shape and it is now impossible to click on the blue shape.

21399iBEA848F1BB1AC400

 

What I would like to be able to do is make a border (not rectangular) that hugs the exact shape of the indicators. Like I said, this is obviously an extreme example, but hopefully you see what I'm talking about.

 

I have searched around the forums and the internet for a solution and I have not found anything, leading me to believe that it might not be possible. But, as no one has actually said it's impossible, I'm still hopeful. 

 

My one glimmer of hope is that some of the Boolean controls are truly round and maybe there is a way to apply this to a custom control.

 

Thanks in advance,

-Aaron

 

0 Kudos
Message 1 of 2
(3,134 Views)

Yes and no (very helpful, I know).

 

Yes, it can be done - the graphics are drawn using both vector and bitmapped images. The vector format allows you to create shaped controls. You can see this if you customize the control and replace the image with something from the decorations palette.

 

The problem, however, is that the vector format (called PICC) is proprietary. There are no tools available for editing it and, if memory serves, any vector graphic you will import from outside LV (such as EMF and WMF, which are supported) will not give you that specific behavior (although I suggest you do try it with a proper program, as opposed to PowerPoint, which is what I usually use, as it might work).

 

What some people do to work around this is use a picture control to draw up the graphics, then analyze where the clicks were using a Mouse Down event and some logic. If you want to simplify your logic, let each block have a distinct color. You can then just look at the color of the pixel which was clicked and use a lookup table to determine which block has that color.


___________________
Try to take over the world!
Message 2 of 2
(3,109 Views)