LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

customize circular graphic in control

Solved!
Go to solution

Hi,

 

I am trying to customize a button control. I have created a graphic to replace one of the standard 'Picture Items' (accessed through the customize control, double click on the graphic).

 

The control i am customizing is circular. The graphic i have created is also circular, i have saved it as a .PNG or .EMF, with the square white background set to transparent.

 

When i 'Import from File'  in LV the import works ok.

 

The issue is the image still has it's square box shape (though the background is transparent), this then makes the control active area square, which means the control can be activated by clicking on the part of it which is transparent (i.e. one of the corners of the bounding box).

 

Is it possible to create a graphic that is round, or get the customized control ignore the transparent areas?

 

-or are all customized controls with imported graphics rectangluar?

 

 

Thanks,

 

Blue 

Download All
0 Kudos
Message 1 of 10
(3,743 Views)

Hi,

 

Please look at the forum post below:

 

http://forums.ni.com/ni/board/message?board.id=170&thread.id=390376

Best regards,

Mark M.
Applications Engineer
National Instruments UK & Ireland
0 Kudos
Message 2 of 10
(3,723 Views)

Thanks for the reply Mark. I have read that post and the associated ones.

 

They do not directly answer my original post. Though the answer appears to be 'No, you can't customize control graphics and have the control work as a circular control'?

 

The linked thread by tst suggests something may be possible using masking, though that example does not allow you to click through the 'cut out', and the circular shape is achieved by using a standard dial and mapping images on to it. -and a pretty complex way to achieve it... just for a basic control.

 

Is it possible to click through the transparent part of an image to activate a control underneath? -the default is no, but can this be changed?

 

Blue 

0 Kudos
Message 3 of 10
(3,716 Views)
Attached (for the second time this morning---hmmmmm) is a gift from the forum I got when I posted a similar question.  Enjoy!

"Should be" isn't "Is" -Jay
0 Kudos
Message 4 of 10
(3,706 Views)

Hello Jeff,

Thanks for the post, but i don't understand how the colour control relates to my question.

 

If i create a customized control (attached to initial post) is it possible to avoid the issue described in the VI (also attached to original post) of invisible/transparent areas being active.

 

Thanks,

 

Blue 

0 Kudos
Message 5 of 10
(3,696 Views)

BlueTwo wrote:

Hello Jeff,

Thanks for the post, but i don't understand how the colour control relates to my question.

 

If i create a customized control (attached to initial post) is it possible to avoid the issue described in the VI (also attached to original post) of invisible/transparent areas being active.

 

Thanks,

 

Blue 


In a limited case yes but not for what you are trying, for two reasons, circlular region and close spacing in the final use.

 

For objects with straight edges I could use transparent decorations in the cusomized control to mask mouse clicks out side the desired region. Since out choice of decorations is very limited, no circle availabel as decoration. So i can create a collection of booleans that look like the cursor control. But if I try to squeeze them close to look like the cursor control the masked regions of adjacent control over-lap... bummer.

 

If you really need this functionality then use a Picture Control with an image of your controls and watch for mouse down and then decide which quadrant the click was in and act accordingly.

 

Just trying to help,

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 6 of 10
(3,673 Views)

Forget my comments about cursor control. I mixed up two threads with similar themes.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 7 of 10
(3,668 Views)

Hi Ben,

 

Ok.... thanks for the info.

 

I'll do some rudimentary masking using decorations if it becomes problematic. -don't fancy learning about picture controls right now, i'll put it on my list.

 

Cheers,

 

Blue 

0 Kudos
Message 8 of 10
(3,663 Views)
Solution
Accepted by topic author BlueTwo

I opened your VI in the LV 2009 beta and I can only change the value of the control when clicking on the imported image. Clicking where the arrow points or anywhere else within the rectangle but outside the black outline does nothing (so it works as you want). I don't know whether this is because of a change in 2009 or something to do with my PC (XP on a virtual machine), but you should be able to find out soon enough when 2009 comes out.

 

Another workaround you can try for now is opening the custom control in the editing mode and moving the shadow to the top of the Z order. Because the shadow isn't clickable and has a "hole" in the middle it might work. It does work here, but again, that might be due to the new version.


___________________
Try to take over the world!
Message 9 of 10
(3,662 Views)

Hey! Great.

 

I'm running XP sp3 on a virtual machine only LV 8.6 though. Just checked it again and it does not work, so may be it is a change for LV 2009.

 

However, changing the Z axis so the border/shadow is on the top does work, though the border needs to be expanded slightly (otherwise the border/shadow is visible on the edge of the control graphic). 

 

Thanks for the tip, a solution i think.  :smileyvery-happy:

 

Blue 

Message Edited by BlueTwo on 07-22-2009 11:25 AM
0 Kudos
Message 10 of 10
(3,645 Views)