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. Bitmap with alpha channel crashes Bitmap () constructor only under Windows 7

Bitmap with alpha channel crashes Bitmap () constructor only under Windows 7

Scheduled Pinned Locked Moved C#
helpgraphicsalgorithmsquestion
8 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.
  • A Offline
    A Offline
    Alan Balkany
    wrote on last edited by
    #1

    Ran into a weird Bitmap problem that I can't find in Google: The Bitmap constructor crashes on a file with an alpha channel under Windows 7, but works perfectly under Windows XP. The code couldn't be simpler:

    Bitmap image = new Bitmap (fname);

    The error is: "Parameter is not valid", and there's no inner exception. If it failed in Windows XP too, I'd suspect a simple bug, but since it works there it implies it's something more complex. Any ideas how a bitmap with an alpha channel can be loaded under Windows 7? Thanks!

    "Microsoft -- Adding unnecessary complexity to your work since 1987!"

    P 1 Reply Last reply
    0
    • A Alan Balkany

      Ran into a weird Bitmap problem that I can't find in Google: The Bitmap constructor crashes on a file with an alpha channel under Windows 7, but works perfectly under Windows XP. The code couldn't be simpler:

      Bitmap image = new Bitmap (fname);

      The error is: "Parameter is not valid", and there's no inner exception. If it failed in Windows XP too, I'd suspect a simple bug, but since it works there it implies it's something more complex. Any ideas how a bitmap with an alpha channel can be loaded under Windows 7? Thanks!

      "Microsoft -- Adding unnecessary complexity to your work since 1987!"

      P Offline
      P Offline
      Pete OHanlon
      wrote on last edited by
      #2

      Is it a plain BMP file?

      *pre-emptive celebratory nipple tassle jiggle* - Sean Ewington

      "Mind bleach! Send me mind bleach!" - Nagy Vilmos

      My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility

      A 1 Reply Last reply
      0
      • P Pete OHanlon

        Is it a plain BMP file?

        *pre-emptive celebratory nipple tassle jiggle* - Sean Ewington

        "Mind bleach! Send me mind bleach!" - Nagy Vilmos

        My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility

        A Offline
        A Offline
        Alan Balkany
        wrote on last edited by
        #3

        It's a TIFF file. I've loaded BMP files (without an alpha channel) with this same code with no problem.

        "Microsoft -- Adding unnecessary complexity to your work since 1987!"

        P 1 Reply Last reply
        0
        • A Alan Balkany

          It's a TIFF file. I've loaded BMP files (without an alpha channel) with this same code with no problem.

          "Microsoft -- Adding unnecessary complexity to your work since 1987!"

          P Offline
          P Offline
          Pete OHanlon
          wrote on last edited by
          #4

          And the same file opens on XP?

          *pre-emptive celebratory nipple tassle jiggle* - Sean Ewington

          "Mind bleach! Send me mind bleach!" - Nagy Vilmos

          My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility

          A 1 Reply Last reply
          0
          • P Pete OHanlon

            And the same file opens on XP?

            *pre-emptive celebratory nipple tassle jiggle* - Sean Ewington

            "Mind bleach! Send me mind bleach!" - Nagy Vilmos

            My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility

            A Offline
            A Offline
            Alan Balkany
            wrote on last edited by
            #5

            Yes. The TIFF file with an alpha channel works perfectly under XP. Both BMP and TIFF files WITHOUT an alpha channel work under both OSes.

            "Microsoft -- Adding unnecessary complexity to your work since 1987!"

            P 1 Reply Last reply
            0
            • A Alan Balkany

              Yes. The TIFF file with an alpha channel works perfectly under XP. Both BMP and TIFF files WITHOUT an alpha channel work under both OSes.

              "Microsoft -- Adding unnecessary complexity to your work since 1987!"

              P Offline
              P Offline
              Pete OHanlon
              wrote on last edited by
              #6

              Possibly a problem with the TIFF codec in Windows 7 then I'm afraid. If I were you, I'd raise a report through Microsoft Connect.

              *pre-emptive celebratory nipple tassle jiggle* - Sean Ewington

              "Mind bleach! Send me mind bleach!" - Nagy Vilmos

              My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility

              A 1 Reply Last reply
              0
              • P Pete OHanlon

                Possibly a problem with the TIFF codec in Windows 7 then I'm afraid. If I were you, I'd raise a report through Microsoft Connect.

                *pre-emptive celebratory nipple tassle jiggle* - Sean Ewington

                "Mind bleach! Send me mind bleach!" - Nagy Vilmos

                My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility

                A Offline
                A Offline
                Alan Balkany
                wrote on last edited by
                #7

                Thanks!

                "Microsoft -- Adding unnecessary complexity to your work since 1987!"

                P 1 Reply Last reply
                0
                • A Alan Balkany

                  Thanks!

                  "Microsoft -- Adding unnecessary complexity to your work since 1987!"

                  P Offline
                  P Offline
                  Pete OHanlon
                  wrote on last edited by
                  #8

                  You're welcome. I'm just sorry I couldn't be of more assistance.

                  *pre-emptive celebratory nipple tassle jiggle* - Sean Ewington

                  "Mind bleach! Send me mind bleach!" - Nagy Vilmos

                  My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility

                  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