none
How to convert a PNG file into an ICO file?

    Question

  • 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!


    Daniel
    Monday, April 20, 2009 7:15 AM

Answers

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.
    Thanks.


    Daniel
    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
    Moderator
  • Thanks guys. I'll have a try on them. btw, is axialis capable of batch converting?


    Daniel
    Monday, April 20, 2009 9:43 AM
  • I don't doubt the retail version can.  Visit their website for feature lists, axialis.com
    Hans Passant.
    Monday, April 20, 2009 2:04 PM
    Moderator
  • 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:  http://www.evanolds.com/pdnicocur.html

    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
    Moderator
  • Thanks. The icon plug-in for paint.net works well. But looks like it's not able to do batch operations, right?
    Daniel
    Tuesday, April 21, 2009 1:30 AM
  • Not directly, no.

    This might help, though: http://paintdotnet.forumer.com/viewtopic.php?f=16&t=20403

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

    Page: http://www.evanolds.com/pdn.html

    Direct link: http://www.evanolds.com/IcoCur.zip


    Saturday, July 07, 2012 1:16 PM