Code:
public void FadeForm() {
Bitmap FadeBmp = new Bitmap(Settings[0] + "fade.jpg");
ColorMatrix CMFade = new ColorMatrix();
ImageAttributes AFade = new ImageAttributes();
FadeBox = new PictureBox();
FadeBox.Location = new Point(0,0);
FadeBox.Size = new Size(this.Width,this.Height);
FadeBox.Visible = false;
this.Controls.Add(FadeBox);
CMFade.Matrix33 = 0.4f;
AFade.SetColorMatrix(CMFade, ColorMatrixFlag.Default, ColorAdjustType.Bitmap);
Graphics g = Graphics.FromImage(FadeBmp);
g.DrawImage((Image)FadeBmp,
new Rectangle(1,1,800,650),
0,0,
800,650,
GraphicsUnit.Pixel,
AFade);
//g.Dispose();
FadeBox.Image = FadeBmp;
FadeBox.Visible = true;
FadeBox.BringToFront();
}
I was using the tutorial found here.
Anyone know if I'm doing something wrong in the code? Or if I'm missing something. Its my first time doing something like this with System.Drawing.
Comment