3
I am making an application for Solidwoks and downloaded some examples, in it are used some BMP images as the following view:
These images are used as images in menus as follows in C code#:
BitmapHandler iBmp = new BitmapHandler();
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 searches the images separately within the same bitmap as if it were or Array of images. In the Solidworks documentation it speaks 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 link.
How to create such a bitmap?
Ok Lucas, I already used the "Embedded Resource" option for images in the project, but my question is why is used a single bitmap file with several images that can be used separately according to an index of the class
SmallIconList
, do not understand how it is possible to create a bitmap of these with several images.– Daniel Masarin
@Danielmasarin , if you call only that
cmdGroup.LargeIconList
. An array of bitmaps is returned?– Lucas Venturella
No, a string is returned with the bitmap location.
– Daniel Masarin