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. Conversion from Bitmap to Icon in GDI+

Conversion from Bitmap to Icon in GDI+

Scheduled Pinned Locked Moved C#
graphicswinformshelp
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.
  • M Offline
    M Offline
    Maciej Pirog
    wrote on last edited by
    #1

    Hello everybody! I would like to convert a Bitmap object (System.Drawing.Bitmap) to an Icon object (System.Drawing.Icon). I tried to use IconConverter class and ImageConverter class:

    ImageConverter ic = new ImageConverter();
    Icon i = (Icon)ic.ConvertTo(bitmap,Icon.GetType());

    I got an exception:

    An unhandled exception of type 'System.NotSupportedException' occurred in system.windows.forms.dll

    Additional information: 'ImageConverter' is unable to convert 'System.Drawing.Bitmap' to 'System.Drawing.Icon'.

    Help me, please!

    Ñ There is only one MP Ð

    J 1 Reply Last reply
    0
    • M Maciej Pirog

      Hello everybody! I would like to convert a Bitmap object (System.Drawing.Bitmap) to an Icon object (System.Drawing.Icon). I tried to use IconConverter class and ImageConverter class:

      ImageConverter ic = new ImageConverter();
      Icon i = (Icon)ic.ConvertTo(bitmap,Icon.GetType());

      I got an exception:

      An unhandled exception of type 'System.NotSupportedException' occurred in system.windows.forms.dll

      Additional information: 'ImageConverter' is unable to convert 'System.Drawing.Bitmap' to 'System.Drawing.Icon'.

      Help me, please!

      Ñ There is only one MP Ð

      J Offline
      J Offline
      jparsons
      wrote on last edited by
      #2

      I wrote a utility to do this one time. Check out the source for a quick solution on how to do this. http://www.prism.gatech.edu/~gte477n/languages/csharp/converter.html[^] Jared jparsons@jparsons.org www.prism.gatech.edu/~gte477n

      M 1 Reply Last reply
      0
      • J jparsons

        I wrote a utility to do this one time. Check out the source for a quick solution on how to do this. http://www.prism.gatech.edu/~gte477n/languages/csharp/converter.html[^] Jared jparsons@jparsons.org www.prism.gatech.edu/~gte477n

        M Offline
        M Offline
        Maciej Pirog
        wrote on last edited by
        #3

        Thanks!

        Ñ There is only one MP Ð

        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