How to convert a PNG file into an ICO file?


  • Hi,

    I'm trying to do an image format conversion from PNG to ICO and haven't found a way to achieve this wit .NET. Does anyone know how to handle this? Thanks a lot!

    Monday, April 20, 2009 7:15 AM


All replies

  • Hi,
    You can try with MSPiant component. I think it may help.
    Monday, April 20, 2009 8:37 AM
  • What is MSPaint component? A .net assembly? Sorry but I've never heard about it and a slight googling doesn't give me much information.

    Monday, April 20, 2009 9:10 AM
  •   Private Function GetIconFromBitmap(ByVal FileName As String) As Icon
        Using Bmp As New Bitmap(FileName)
          Return Icon.FromHandle(Bmp.GetHicon)
        End Using
      End Function
    Monday, April 20, 2009 9:26 AM
  • MSPaint can't create icons.  You can do it with Bitmap.GetHicon(), then Icon.FromHandle() but it is not likely you'll appreciate the result.  Color mapping is poor.  You might want to consider this project instead.  You'll get the best and most predictable results with an icon drawing program.  Here's a free one for Visual Studio 2008 (not Express).

    Hans Passant.
    Monday, April 20, 2009 9:27 AM
  • Thanks guys. I'll have a try on them. btw, is axialis capable of batch converting?

    Monday, April 20, 2009 9:43 AM
  • I don't doubt the retail version can.  Visit their website for feature lists,
    Hans Passant.
    Monday, April 20, 2009 2:04 PM
  • GIMP is free and can create windows icons too.
    Monday, April 20, 2009 6:20 PM
  • Paint.Net has a great add-on for doing this:

    This lets you convert from PNG to ICO files, including supporting multiple resolutions in one shot.  It's incredibly handy for editing icons.
    • Marked as answer by Zhi-Xin Ye Friday, April 24, 2009 1:31 PM
    Monday, April 20, 2009 6:29 PM
  • Thanks. The icon plug-in for works well. But looks like it's not able to do batch operations, right?
    Tuesday, April 21, 2009 1:30 AM
  • Not directly, no.

    This might help, though:

    Tuesday, April 21, 2009 4:40 AM
  • There is a new download link for this one: 


    Direct link:

    Saturday, July 07, 2012 1:16 PM