Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » Odd sized icons have black line on bottom or right edges Collapse All
Subject Author Date
Malcolm D Apr 23, 2008 - 6:45 PM

I seems that the loading of icons (from  HICON) assumes the icon size is even, and hence here is a black line at the bottom and/or right edges if the size of the icons width or hieght is not even. In the following function the following code change fix it for me, since the value of _sizeIcon.cx and .cy are always made even. I’m not sure if they are any other places which have this issue


bool CExtBitmap::AssignFromHICON




 //if( _sizeIcon.cx == 0 || _sizeIcon.cy == 0 ) (old line)

 if( _bmpInfo.bmWidth > 0 && _bmpInfo.bmHeight > 0 ) // (new line)

 {

  _sizeIcon.cx = (INT)_bmpInfo.bmWidth;

  _sizeIcon.cy = (INT)_bmpInfo.bmHeight;

 }

Technical Support Apr 24, 2008 - 1:41 PM

Thank you for reporting this very interesting issue. We are partially agree with your fix because one more condition is needed:

if( _bmpInfo.bmWidth > 0 && _bmpInfo.bmHeight > 0 && _bmpInfo.bmBitsPixel > 1 )
The monochrome icons and cursors are special and the conditions above are friendly to them. This issue can be verified with the IconEditor sample.