M
Michael
My command bar pictures are displaying improperly in Visio 2007 when they
were correct in Visio 2003 and Visio 2002. My C++ code is basically this:
Office::_CommandBarButton* pCmdBarBtn = SomeCommandBarButton;
PICTDESC PictDesc;
PictDesc.cbSizeofstruct = sizeof(PictDesc);
PictDesc.picType = PICTYPE_BITMAP;
HICON hIcon = (HICON)LoadImage(hInstance, MAKEINTRESOURCE(nIconResource),
IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR);
ICONINFO IconInfo;
GetIconInfo(hIcon, &IconInfo);
PictDesc.bmp.hbitmap = IconInfo.hbmColor;
PictDesc.bmp.hpal = NULL;
CComPtr<IPictureDisp> pColor;
OleCreatePictureIndirect(&PictDesc, __uuidof(pColor), TRUE, (void**)&pColor);
pCmdBarBtn->PutPicture(pColor);
CComPtr<IPictureDisp> pMask;
PictDesc.bmp.hbitmap = IconInfo.hbmMask;
PictDesc.bmp.hpal = NULL;
OleCreatePictureIndirect(&PictDesc, __uuidof(pMask), TRUE, (void**)&pMask);
pCmdBarBtn->PutMask(pMask);
The resources are RT_GROUP_ICON type and contain 16x16 16 color icons.
Visio is attempting to render the icons because I can make out the basic
shape but the coloring is incorrect. Am I doing something wrong or has a bug
been introduced here?
BTW my OS is XP Pro/SP2.
Thanks.
were correct in Visio 2003 and Visio 2002. My C++ code is basically this:
Office::_CommandBarButton* pCmdBarBtn = SomeCommandBarButton;
PICTDESC PictDesc;
PictDesc.cbSizeofstruct = sizeof(PictDesc);
PictDesc.picType = PICTYPE_BITMAP;
HICON hIcon = (HICON)LoadImage(hInstance, MAKEINTRESOURCE(nIconResource),
IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR);
ICONINFO IconInfo;
GetIconInfo(hIcon, &IconInfo);
PictDesc.bmp.hbitmap = IconInfo.hbmColor;
PictDesc.bmp.hpal = NULL;
CComPtr<IPictureDisp> pColor;
OleCreatePictureIndirect(&PictDesc, __uuidof(pColor), TRUE, (void**)&pColor);
pCmdBarBtn->PutPicture(pColor);
CComPtr<IPictureDisp> pMask;
PictDesc.bmp.hbitmap = IconInfo.hbmMask;
PictDesc.bmp.hpal = NULL;
OleCreatePictureIndirect(&PictDesc, __uuidof(pMask), TRUE, (void**)&pMask);
pCmdBarBtn->PutMask(pMask);
The resources are RT_GROUP_ICON type and contain 16x16 16 color icons.
Visio is attempting to render the icons because I can make out the basic
shape but the coloring is incorrect. Am I doing something wrong or has a bug
been introduced here?
BTW my OS is XP Pro/SP2.
Thanks.