Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Image to ICO

Image to ICO

Scheduled Pinned Locked Moved C#
helpcsharpcomtutorialquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jgallen23
    wrote on last edited by
    #1

    I am trying to convert a picturebox into an ICO. I found out that it is a known bug that the ImageFormat.Icon does not encode the image correctly. Using this article: http://www.codeproject.com/dotnet/MultiIcon.asp I know how to encode the icon, the only problem is, that I need to get the image's raw bytes to write to the image. Does anybody have any idea how to do this or a better way to convert an image or png to an ico? JGA

    E 1 Reply Last reply
    0
    • J jgallen23

      I am trying to convert a picturebox into an ICO. I found out that it is a known bug that the ImageFormat.Icon does not encode the image correctly. Using this article: http://www.codeproject.com/dotnet/MultiIcon.asp I know how to encode the icon, the only problem is, that I need to get the image's raw bytes to write to the image. Does anybody have any idea how to do this or a better way to convert an image or png to an ico? JGA

      E Offline
      E Offline
      enjoycrack
      wrote on last edited by
      #2

      Hi there,

      jgallen23 wrote:

      I found out that it is a known bug that the ImageFormat.Icon does not encode the image correctly

      You might take a look on this article to get the solution Icon

      jgallen23 wrote:

      png to an ico

      also take a look on this Png2Icon << >>

      J 1 Reply Last reply
      0
      • E enjoycrack

        Hi there,

        jgallen23 wrote:

        I found out that it is a known bug that the ImageFormat.Icon does not encode the image correctly

        You might take a look on this article to get the solution Icon

        jgallen23 wrote:

        png to an ico

        also take a look on this Png2Icon << >>

        J Offline
        J Offline
        jgallen23
        wrote on last edited by
        #3

        enjoycrack wrote:

        You might take a look on this article to get the solution Icon

        here's are the problems with that article: The source Bitmap must use PixelFormat.Format24BppRgb The source Bitmap must use at most 256 colors The source Bitmap must be 16x16 pixels The target Icon must be 16x16 pixels The pixel in the lower left corner (0, 15) is used to determine the transparency color JGA

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups