dstudwell Posted March 22, 2006 Report Share Posted March 22, 2006 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 Quote Link to comment
didierj Posted March 22, 2006 Report Share Posted March 22, 2006 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 Quote Link to comment
dstudwell Posted March 22, 2006 Author Report Share Posted March 22, 2006 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 Quote Link to comment
Yair Posted March 22, 2006 Report Share Posted March 22, 2006 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. Quote Link to comment
Rolf Kalbermatter Posted March 27, 2006 Report Share Posted March 27, 2006 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 Quote Link to comment
dstudwell Posted March 28, 2006 Author Report Share Posted March 28, 2006 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 Quote Link to comment
Rolf Kalbermatter Posted March 28, 2006 Report Share Posted March 28, 2006 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 Quote Link to comment
Michael Aivaliotis Posted March 28, 2006 Report Share Posted March 28, 2006 Here's your solution... Download File:post-2-1143581551.vi Quote Link to comment
dstudwell Posted March 31, 2006 Author Report Share Posted March 31, 2006 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 Quote Link to comment
Michael Uray Posted December 21, 2020 Report Share Posted December 21, 2020 Is there actually still no way to import (vector) graphics / shapes into LabVIEW which can be colored programmatically? Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.