I have a .png file, with alpha channel, that I use as the BackgroundImage on a Panel control. Under certain circumstances the control is disabled. When it is disabled I want the background image to be 50% transparent so that the user gets some sort of visual indication as to the controls state.
Does anyone know how I can make a Bitmap image 50% transparent?
The only possible solution I have at this stage is to draw the bitmap image to a new bitmap and then draw over the top of it using the background colour of the panel. Whilst this works it is not my prefered solution, hence this question.
Best Answer
Here is some code that adds an alpha channel to an image. If you want 50% alpha, you would set 128 as the alpha argument. Note this creates a copy of the bitmap...