This document is archived and information here might be outdated.  Recommended version.


ICommand.Bitmap Property (ArcObjects .NET 10.8 SDK)
ArcObjects Help for .NET developers > ArcObjects Help for .NET developers > ArcObjects namespaces > SystemUI > ESRI.ArcGIS.SystemUI > Interfaces > IC > ICommand Interface > ICommand.Bitmap Property
ArcGIS Developer Help

ICommand.Bitmap Property

The bitmap that is used as the icon on this command.

[Visual Basic .NET]
Public ReadOnly Property Bitmap As Integer
[C#]
public int Bitmap {get;}
[C++]
HRESULT get_Bitmap(
  OLE_HANDLE* Bitmap
);
[C++]
Parameters
Bitmap [out, retval]

Bitmap is a parameter of type OLE_HANDLE*

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Remarks

When implementing ICommand to create a custom command, use the Bitmap property to set the bitmap to be used as the icon on this command. In your Visual Basic project for this command, the bitmap can be stored in a resource file or in a PictureBox control on a form.

You must use a Bitmap file (.bmp) for the Bitmap property; Icon files (.ico) are not supported. Bitmap files should be 16 X 16 pixels. The color of the upper left pixel of the bitmap is treated as the transparent color. For example, if the upper left pixel of the bitmap is red, then all of the red pixels in the bitmap will be converted to transparent.

When a command is put on a toolbar, the command is displayed with the bitmap only by default; the display type is set to Image Only (ICommandItem::Style = esriCommandStyleIconOnly). When a command is put on a menu, the command is displayed with the bitmap and caption by default; the display type is set to Image and Text (ICommandItem::Style = esriCommandStyleIconAndText). However, if the Bitmap property is not set for this command, then the command will be displayed with the caption only by default when it is put on a toolbar or menu; the display type is set to Text Only (ICommandItem::Style = esriCommandStyleTextOnly).

Starting at ArcGIS 10.0, updating command's bitmap at runtime requires calling IApplicationRefreshBitmap::RefreshBitmap.

See Also

ICommand Interface