News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Icon stretched

Started by starzboy, August 01, 2009, 02:53:16 PM

Previous topic - Next topic

starzboy

I have created a little icon of 16x16, i am then using createwindow to display my icon using SS_ICON OR SS_CENTERIMAGE. The icon shows fine bu it is stretched and the image loks blurred. I adjusted the height and width of the display, now only a portion of the blurred icon is being displayed, how do I fix this ?

code:
invoke    CreateWindowEx,0,chr$("Static"),chr$("Icon"),WS_CHILD Or WS_VISIBLE Or WS_TABSTOP OR SS_ICON OR SS_CENTERIMAGE,445,210,16,16,hWnd,1200,hInstance,0
invoke    SendMessage,eax, STM_SETIMAGE,IMAGE_ICON,dword ptr ds:[hIcon]

Ficko

Hi Starzboy,

Your approach is not that realistic.

Usual steps would be:

1.) Load the icon from resource or file with "LoadImage".

2.) Display it with "DrawIcon".

Between 1 and 2 you would also creat a compatibleDC with "CreateCompatibleDC".

Ficko

hutch--

starzboy,

Usually when you create an icon you do multiple resolution versions so each size looks OK. a 16 x 16 for the title bar, a 32 x 32 for a normal desktop icon and bigger if you want it to look OK at a larger size.

Note that a 16 colour icon is reasonably small where the 24 bit with a transparent channel are much larger so if the app size matters, reduce the colour depth.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php