Adjusting alpha of an image with .NET?
-
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. :)
-
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. :)
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.