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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Visual Studio
  4. Image File Transparency

Image File Transparency

Scheduled Pinned Locked Moved Visual Studio
graphicsquestion
4 Posts 3 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.
  • V Offline
    V Offline
    VFaul
    wrote on last edited by
    #1

    I am loading a bitmap image into a picturebox that resides on a panel. I would like certain pixels of the image to be transparent so that the panel's color shows through the transparent pixels. Is there any way to set pixels in a bitmap, jpeg, etc. so that they are transparent? Thanks VF

    V T 2 Replies Last reply
    0
    • V VFaul

      I am loading a bitmap image into a picturebox that resides on a panel. I would like certain pixels of the image to be transparent so that the panel's color shows through the transparent pixels. Is there any way to set pixels in a bitmap, jpeg, etc. so that they are transparent? Thanks VF

      V Offline
      V Offline
      Vivek Narayanan
      wrote on last edited by
      #2

      You can't make a picturebox or a panel transparent but you can make a form transparent by adjusting its opacity property

      1 Reply Last reply
      0
      • V VFaul

        I am loading a bitmap image into a picturebox that resides on a panel. I would like certain pixels of the image to be transparent so that the panel's color shows through the transparent pixels. Is there any way to set pixels in a bitmap, jpeg, etc. so that they are transparent? Thanks VF

        T Offline
        T Offline
        Thomas Stockwell
        wrote on last edited by
        #3

        I would suggest you create a customer usercontrol that has a backcolor and then a custom drawing routine at which point you would draw the bitmap to the control. You could import the bitmap file into a Bitmap object and then use the MakeTransparent(Color c) to make a sepcifc color transparent.

        Regards, Thomas Stockwell Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. Visit my homepage Oracle Studios[^]

        V 1 Reply Last reply
        0
        • T Thomas Stockwell

          I would suggest you create a customer usercontrol that has a backcolor and then a custom drawing routine at which point you would draw the bitmap to the control. You could import the bitmap file into a Bitmap object and then use the MakeTransparent(Color c) to make a sepcifc color transparent.

          Regards, Thomas Stockwell Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. Visit my homepage Oracle Studios[^]

          V Offline
          V Offline
          VFaul
          wrote on last edited by
          #4

          MakeTransparent works great! Thanks.

          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