LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Distribution with toolbar image issues

Hi,
    I use toolbar.fp in my project and Toolbar_InsertItem function to add image on toolbar item button.
In the Toolbar_InsertItem function, I make parameter "Image File" the detail file name(.icon) in my computer.
When I make Distribution, if I can't select all my .icon files to install, my toolbar in the program is not visible.
Furthermore I install all the .icon files, if user delete them, my toolbar in the program is also not visible.
    Since my toolbar include many .icon files, Is there any way to use toolbar image without installing such image files?
 
    Thanks a lot.
0 Kudos
Message 1 of 3
(3,349 Views)
If you don't want to distribute all the individual .ico files with your application, you can do the following:
 
1. In your .uir file, create an additional panel and place a picture ring control in it.
2. Insert all of your images in the picture ring.
3. At runtime, load the panel, but don't display it.
 
For each toolbar item that you create, do the following:
 
1. Pass NULL as the file name parameter to the Toolbar_InsertItem function.
2. Get the corresponding bitmap for this item from the picture ring by calling GetCtrlBitmap.
3. Insert the bitmap in the toolbar item by calling Toolbar_GetItemAttribute with the TOOLBAR_ATTR_BUTTON_BITMAP attribute.
4. Discard the bitmap using DiscardBitmap
 
Luis
0 Kudos
Message 2 of 3
(3,333 Views)
Follow your advice, I resolve my problems. Thanks a lot !Smiley Very Happy
0 Kudos
Message 3 of 3
(3,319 Views)