Code: Select all
UsePNGImageDecoder()
#IMAGE_ICON = 1
CatchImage(100, ?myimage)
pcon.ICONINFO
pcon\fIcon = #True
pcon\hbmMask = ImageID(100)
pcon\hbmColor = ImageID(100)
hIcon = CreateIconIndirect_(pcon)
hIcon = CopyImage_(hIcon,#IMAGE_ICON,32,16,#LR_COPYDELETEORG) ;Change size to 32 x 16
FreeImage(101)
< begin other window making/display code here ... If OpenWindow(0, ....etc...>
ImageGadget(1,100,20,32,16,hIcon)
<end other window making/display code here>
DataSection
myimage: : IncludeBinary "D:\Test\myimage.png" ; where myimage.png original size is 64 x 32
EndDataSection
To experiment, I also tried to set it as the window icon with this:
Code: Select all
<...same other code here for structure, window, etc.. except I changed to this to experiment and didn't use the button...>
hIcon = CopyImage_(hIcon,#IMAGE_ICON,16,16,#LR_COPYDELETEORG) ;Change size to 16 x 16
SendMessage_(WindowID(0), #WM_SETICON, 0, hIcon)
What am I doing wrong to resize this image properly? Am I doing this wrong?
(Windows 10 pro system, PureBasic 6.11 LTS (Windows - x64) )