title: Changing the Opacity of a Bitmap image
body: <p>I have a form which has a image. I am using a slider to change the opacity of the image. So in the "ValueChanged" event of the slider I am calling the following method to change the opacity.</p>
  
  <pre><code>//Setting the opacity of the image
  public static Image SetImgOpacity(Image imgPic, float imgOpac)
  {   
       Bitmap bmpPic = new Bitmap(imgPic.Width, imgPic.Height);
       Graphics gfxPic = Graphics.FromImage(bmpPic);
  
       ColorMatrix cmxPic = new ColorMatrix();   
       cmxPic.Matrix33 = imgOpac;   
       ImageAttributes iaPic = new ImageAttributes();   
       iaPic.SetColorMatrix(cmxPic, ColorMatrixFlag.Default, ColorAdjustType.Bitmap);  
       gfxPic.DrawImage(imgPic, new Rectangle(0, 0, bmpPic.Width, bmpPic.Height), 0, 0, imgPic.Width, imgPic.Height, GraphicsUnit.Pixel, iaPic);  
       gfxPic.Dispose();            
  
       return bmpPic;  
  }
  </code></pre>
  
  <p>The returned Image is set to the original image.</p>
  
  <p>My problem is that the opacity of the image is not changing... If there is any error please be kind enough to point out.. Thnx...</p>