Hi,
I am getting unexpected results when I call ImageAttributes.SetGamma. Specifically, calling with a parameter less than 1.0 causes the drawn bitmap to be brighter, and with param more than 1.0 causes the bitmap to come out darker. At least something is happening, but I thought that higher gamma values are associated with increased intensity. (but this may just be my misunderstanding). Is this the way it's supposed to work Thanks for any help...(oh, here is a code fragment)...
ImageAttributes imageAttr = new ImageAttributes();
imageAttr.SetGamma( newGamma );
Bitmap newBitmap = new Bitmap( this.Width, this.Height, this.PixelFormat );
Graphics g = Graphics.FromImage( newBitmap );
Rectangle rect = new Rectangle( new Point( 0, 0 ), new Size( this.Width, this.Height ) );
g.DrawImage( this.Bitmap, rect, 0, 0, this.Width, this.Height, GraphicsUnit.Pixel,
imageAttr ); // image color intensity comes out opposite to what I expected...
Visual C#7
|