Home > Graphics > How to Stretch an Icon

How to Stretch an Icon

December 15th, 1999 Leave a comment Go to comments

Although Delphi’s StretchDraw() function should work for icons it doesn’t :-) The way to get round this is to use the Windows API DrawIconEx() function.

(* iNewWidth  - (Integer) New icon width
** iNewHeight - (Integer) New icon height
*)
DrawIconEx(Canvas.Handle, 0, 0, Icon.Handle, iNewWidth, iNewHeight, 0, 0, DI_NORMAL);
  1. Peter
    April 6th, 2010 at 15:54 | #1

    Thanks a lot. I looked everywhere for it. I hate it if Delphi does not what it’s supposed to do.