vugie Posted November 26, 2009 Report Share Posted November 26, 2009 (edited) Cross-post I found the way how to change image on boolean button without using control editor. Essentially you have to to manually insert a png as button image and then replace it with another png programmatically inside .ctl file. The only condition is that initial png file has to have greater filesize than new one. If you want to make a lot of buttons just create first one using biggest PNG (by file size not dimensions). Technically it should be possible to replace any image inside a control with this method. As .ctl file looks exactly like macintosh resource fork, it should be also possible to omit the limitation of smaller size, by updating respective offsets within a file, however I failed with first trials (not many). Example attached - LV8.2 buttontest.zip Edited November 26, 2009 by vugie 2 Quote Link to comment
Francois Normandin Posted November 26, 2009 Report Share Posted November 26, 2009 You know you're gonna make tons of happy people. I'll be able to automate the UI Tools button creation. Quote Link to comment
jcarmody Posted November 26, 2009 Report Share Posted November 26, 2009 You know you're gonna make tons of happy people. Nine people of my size will be the first ton. Quote Link to comment
Ton Plomp Posted November 26, 2009 Report Share Posted November 26, 2009 Nine people of my size will be the first ton. I will be the second, Ton 2 Quote Link to comment
vugie Posted November 27, 2009 Author Report Share Posted November 27, 2009 Ok, I made it with even simpler way and withouth the limitation of size: Respective VIs are located in: <LV_DIR>\resource\plugins\NewDialogFiles\ProjectWizards\IDNPA\CloneIDProject\dependencies\ResManager In this case I'm searching only for PNG's header (well, part of). If there are more PNGs within control you have to search for something more specific. Rolf, thanks for inspiration... buttontest2.zip 1 Quote Link to comment
Francois Normandin Posted November 28, 2009 Report Share Posted November 28, 2009 Ok, I made it with even simpler way and withouth the limitation of size When I feel better, I'll try it. I got swine flu apparently. Quote Link to comment
jgcode Posted November 28, 2009 Report Share Posted November 28, 2009 When I feel better, I'll try it. I got swine flu apparently. Dude, thats nasty! I had the flu (swine?) bad this winter too, it sucks. Wishing you a speedy recovery from the swine flu - hope you feel better soon! Quote Link to comment
vugie Posted November 30, 2009 Author Report Share Posted November 30, 2009 Here is small utility VI to create system button with a given image. François, you have my blessing to include it in your UI Tools and modify as you like (particularly to include hover states) Create Button with Image.vi 1 Quote Link to comment
Francois Normandin Posted November 30, 2009 Report Share Posted November 30, 2009 Here is small utility VI to create system button with a given image. François, you have my blessing to include it in your UI Tools and modify as you like (particularly to include hover states) With proper acknowledgement, it's gonna be a pleasure... thanks again. Quote Link to comment
Bjarne Joergensen Posted December 9, 2009 Report Share Posted December 9, 2009 (edited) With proper acknowledgement, it's gonna be a pleasure... thanks again. Hi I can't find this file "id_save resource binary file.vi" in LV2009. Is it an old one that is not supported anymore? Best regards Bjarne Edited December 9, 2009 by Bjarne Joergensen Quote Link to comment
Francois Normandin Posted December 9, 2009 Report Share Posted December 9, 2009 Hi I can't find this file "id_save resource binary file.vi" in LV2009. Is it an old one that is not supported anymore? Hello Bjarne, indeed, you can find those in LV8.x folders. If they exist in LV2009. I haven't found them (or they changed name). Quote Link to comment
smenjoulet Posted December 9, 2009 Report Share Posted December 9, 2009 Hello Bjarne, indeed, you can find those in LV8.x folders. If they exist in LV2009. I haven't found them (or they changed name). Changed Name and location C:\Program Files\National Instruments\LabVIEW 2009\vi.lib\Palette API\ResMgr\Save Resource.vi -Scott Quote Link to comment
Bjarne Joergensen Posted December 11, 2009 Report Share Posted December 11, 2009 Changed Name and location C:\Program Files\National Instruments\LabVIEW 2009\vi.lib\Palette API\ResMgr\Save Resource.vi -Scott Thank you. I found them, but I got this error: This VI cannot access the referenced item because of library access scope. Items in private scope can be accessed only from the following locations: 1) from inside the owning library or LabVIEW class 2) from inside a library contained by the owning library. Why is that? Regards Bjarne Quote Link to comment
smenjoulet Posted December 12, 2009 Report Share Posted December 12, 2009 This VI cannot access the referenced item because of library access scope. Items in private scope can be accessed only from the following locations: 1) from inside the owning library or LabVIEW class 2) from inside a library contained by the owning library. Why is that? Because it is part of a library and is marked as a private item. Looks like you'll need to use the one from 8.6. -Scott Quote Link to comment
Bjarne Joergensen Posted December 13, 2009 Report Share Posted December 13, 2009 Because it is part of a library and is marked as a private item. Looks like you'll need to use the one from 8.6. -Scott Thank you, I'll do that /Bjarne 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.