Mam taki prosty kod:
var Icon:HIcon;
begin
Icon:=LoadImage(0, MAKEINTRESOURCE(OIC_WARNING), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR or LR_SHARED);
DrawIcon(Canvas.Handle, 10, 10, Icon);
DestroyIcon(Icon);
end;
Prosty, ale nie działa jak trzeba, bo bez względu na to, jaki rozmiar ikony w LoadImage podam, zawsze otrzymuję ikonę systemową 32x32.
A przecież,
MSDN napisał(a)
cxDesired
[in] Specifies the width, in pixels, of the icon or cursor. If this parameter is zero and the fuLoad parameter is LR_DEFAULTSIZE, the function uses the SM_CXICON or SM_CXCURSOR system metric value to set the width. If this parameter is zero and LR_DEFAULTSIZE is not used, the function uses the actual resource width.
cyDesired
[in] Specifies the height, in pixels, of the icon or cursor. If this parameter is zero and the fuLoad parameter is LR_DEFAULTSIZE, the function uses the SM_CYICON or SM_CYCURSOR system metric value to set the height. If this parameter is zero and LR_DEFAULTSIZE is not used, the function uses the actual resource height.
W dodatku ikony systemowe na pewno mają swoje małe rozmiary - bez problemu można ustawić je formie czy innym elementom.
Czy spotkał się ktoś z takim problemem lub wie jak go rozwiązać?