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. .NET (Core and Framework)
  4. Adjusting alpha of an image with .NET?

Adjusting alpha of an image with .NET?

Scheduled Pinned Locked Moved .NET (Core and Framework)
csharpdotnetwinformsgraphicsarchitecture
2 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
    Jon Rista
    wrote on last edited by
    #1

    Ok, here is a scenario. I need to adjust the alpha level of an icon under certain circumstances. Namely, for a disabled control. I only need to adjust the alpha level of the whole image, I don't need an alpha channel or map or anything like that. I don't know, and have been unable to find, any "quick and easy" way of doing this with the .NET framework. I know GDI+ has the ability to use alpha mapping, but it seems you can only do that with solid or texture brushes. I havn't found any kind of DrawImage or DrawIcon function that takes an alpha value. Does anyone know a simple way of modifying the alpha value of an image? Something that doesn't require adjusting the color value of every pixel in an image? Thanks much. :)

    S 1 Reply Last reply
    0
    • J Jon Rista

      Ok, here is a scenario. I need to adjust the alpha level of an icon under certain circumstances. Namely, for a disabled control. I only need to adjust the alpha level of the whole image, I don't need an alpha channel or map or anything like that. I don't know, and have been unable to find, any "quick and easy" way of doing this with the .NET framework. I know GDI+ has the ability to use alpha mapping, but it seems you can only do that with solid or texture brushes. I havn't found any kind of DrawImage or DrawIcon function that takes an alpha value. Does anyone know a simple way of modifying the alpha value of an image? Something that doesn't require adjusting the color value of every pixel in an image? Thanks much. :)

      S Offline
      S Offline
      SHaroz
      wrote on last edited by
      #2

      When the image is drawn on the screen, it is essentially painted pixel-by-pixel. So modifying the alpha value of each pixel would be no different from changing the alpha value of the entire image. The only way I know of editing a picture is one pixel at a time. Sorry I didn't have the answer you were looking for.

      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