Bitmap Array in a single file

3

I am making an application for Solidwoks and downloaded some examples, some BMP images are used in it as the following view:

TheseimagesareusedasimagesinmenusasfollowsinC#code:

BitmapHandleriBmp=newBitmapHandler();cmdGroup=iCmdMgr.CreateCommandGroup2(mainCmdGroupID,TitleDr,ToolTipDr,"", -1, ignorePrevious, ref cmdGroupErr);
cmdGroup.LargeIconList = iBmp.CreateFileFromResourceBitmap("EngToolsSW.ToolbarLarge.bmp", thisAssembly);
cmdGroup.SmallIconList = iBmp.CreateFileFromResourceBitmap("EngToolsSW.ToolbarSmall.bmp", thisAssembly);
cmdGroup.LargeMainIcon = iBmp.CreateFileFromResourceBitmap("EngToolsSW.MainIconLarge.bmp", thisAssembly);
cmdGroup.SmallMainIcon = iBmp.CreateFileFromResourceBitmap("EngToolsSW.MainIconSmall.bmp", thisAssembly);

That is, it fetches the images separately within the same bitmap as if it were an Image Array. In the Solidworks documentation speak this way:

  

The bitmap or PNG file should contain all of the images for all of the large buttons and separators for this CommandGroup, in a single bitmap for both parent and child toolbars. Each image of each button must be 24x24. The images should use a 256-color palette. Use gray (RGB 192, 192, 192) for transparent areas in your graphic.

     

You can only set this property for the top-level CommandGroup.

available in this .

How can I create a bitmap of these?

    
asked by anonymous 21.07.2014 / 22:00

1 answer

1

You basically add the file to your project in Visual Studio. Then you open the dialog box with the properties of the file. There will be a field named "Build Action" that defines it as "Embedded Resource". After that you will be able to access these files in the same way that you are doing in the example. Just use the dll that Visual Studio generates.

Reference: link

    
23.07.2014 / 09:40