Jump to content

Custom Controls - Custom Decorations


Recommended Posts

Does anyone know:

1) a way to import a graphic that allows it to be colored like native LV controls?

or

2) create and import/use a custom decoration?

I'm trying to use the old color ramp control but would like to have it be a hexagon shape. I've created one using a cluster of three color ramps (in example, LV 7.1) but was wondering if there was a way to create a custom hexagon decoration to import into the color ramp. I've used this method in the past to make up/down arrow buttons but was wondering what is the secret to importing a custom decoration that can still be colored (FG, BG) like a native decoration.

Thanks,

Doug

Download File:post-2152-1142987440.vi

Link to comment

Hmmm... I see two workarounds:

1. place decos over your color rams so you get the hexagon

2. simulate a color ramp with a picture control. Since it knows the mouse-down, mouse-move, mouse-leave events, you can get the mouse-position in the picture control and then draw a hexagon into the same picture.

Didier

Link to comment

Thanks for the quick reply.

For my first version, I used three color ramps to create the hexagon and would change the value of the other two to match the first. I did this by replacing the standard color ramp with a triangle decoration. (see attached VI)

If it is possible to make custom decorations, I could just create a LabVIEW compatible decoration in the shape of a hexagon and have my control.

Is there anything special about a LabVIEW decoration? I have tried copying the decoration to paint and then back into LabVIEW but it loses its ability to be edited (FG, BG color) like a normal (native) decoration.

If custom decorations are possible, it would vastly open up the ability to create custom controls.

Thanks again,

Doug

Link to comment

LV decorations are vector graphics objects and not regular images (an NI AE once said that their format was called PICC, or picture in C format). Normally, you can copy in vectoric images from other programs (like Word or Powerpoint) and resize them freely, but you won't be able to change their color. It seems that this is reserved to LV elements. You could try finding an LV graphic element with the right shape and ransacking it, but I don't know of one.

Link to comment
LV decorations are vector graphics objects and not regular images (an NI AE once said that their format was called PICC, or picture in C format). Normally, you can copy in vectoric images from other programs (like Word or Powerpoint) and resize them freely, but you won't be able to change their color. It seems that this is reserved to LV elements. You could try finding an LV graphic element with the right shape and ransacking it, but I don't know of one.

PICT is an old vector graphic format used on the Mac. LabVIEW supports PICT directly and can import them and use them and I do believe PICC is a similar but a little bit modified format for LabVIEW's native internal vector graphics.

Rolf Kalbermatter

Link to comment

Thanks for the information. Does anyone know of a process or tool that will allow me to edit decorations or create new objects?

Can I just try to edit or create them into Adobe Photoshop and save them as a file type that LabVIEW can read? I'll give it a try if no one knows for certain.

Thanks again,

Doug

Link to comment
Thanks for the information. Does anyone know of a process or tool that will allow me to edit decorations or create new objects?

Can I just try to edit or create them into Adobe Photoshop and save them as a file type that LabVIEW can read? I'll give it a try if no one knows for certain.

Thanks again,

Doug

I don't think there are any editors for the PICC format outside of NI. And it wouldn't be very useful in most cases.

What you can do is copying decorations and subparts from other controls in the customize mode and paste them into parts of your control. This works usually quite good, although there is every now and then a crash. The control editor is a great piece of work introduced way back in the earliest versions of LabVIEW but with certain limitations and crash potential and unfortunately it has never been substantially improved since.

Rolf Kalbermatter

Link to comment

Thanks for the code demonstration. I had actually tried something similar before and decided to go with it. I placed the decorations and the control in a cluster so I can place multiple controls closer together. (See attached. LV v7.1 Must download both VIs.)

I am still interested in finding a way to create custom decorations or controls by importing LV compatible vector graphics (that can be re-colored).

Thanks again for all the help.

Doug

Download File:post-2152-1143831648.ctl Download File:post-2152-1143831657.ctl

Link to comment
  • 14 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.