How to convert icon to png with alpha transparency in delphi?

前端 未结 3 954
萌比男神i
萌比男神i 2021-02-09 10:15

The code below will extract icon from file and convert it to png but without alpha transparency ?

var
   IconIndex : word;
   icon:TIcon;
   png:TPngImage;
   bm         


        
3条回答
  •  死守一世寂寞
    2021-02-09 10:50

    The PngComponents contain a unit PngFunctions.pas, where you can have a look at

    procedure ConvertToPNG(Source: TGraphic; out Dest: TPngImage);

    There you can find the code to convert a TIcon into a TPngImage - or just use that procedure.

提交回复
热议问题