I want to do a very "simpel" thing. Draw an small Icon in 16x16. Now this
seems as an fairly easy task. Ive tried using TImage Assigning Icon.Handle,
even with the Stretch On it wont resize it to 16x16. Ive tryied to use
DrawIcon(), it also resizes the Icon to 32x32. DrawIconEx() SHOULD do the
work as you can enter the Width,Height. But Im getting a "invalid variant
type conversion"-exeption. the ErrorLine is:
DrawIconEx(pbCmd.Canvas.Handle,0,0,MainView.Icon,16,16,NULL,0,DI_NORMAL);
The HICON is Loaded from various ways as ExtractIcon & SHGetFileInfo.
Daniel
Check out LoadImage and CopyImage in the Win32 API online help. I think
these can scale icons, but I'm not sure.
Another thing you could do is create a bitmap and draw the icon to that, and
then stretch the bitmap, but then you have to deal with masking.
If all else fails, there's always ImageEdit.
Davie Reed <da...@smatters.com> wrote in message
news:386133B6...@smatters.com...
Daniel
Davie Reed <da...@smatters.com> wrote in message
news:386147AA...@smatters.com...
You get the error because you use NULL. Delphi is not C, NULL is a predefined
Variant constant in Delphi, not a placeholder for 0 or Nil like in C.
Peter Below (TeamB) 10011...@compuserve.com)
No replies in private e-mail, please, unless explicitly requested!