, Visual C#


- 3


private void pictureBox1_Paint(object sender,

PaintEventArgs e)

{

// myImage1

// myRectangle:

e.Graphics.DrawImage(myImage1, myRectangle);

// myColorMatrix

// :

myImageAttributes.SetColorMatrix(myColorMatrix);

// myImage2:

e.Graphics.DrawImage(myImage2, myRectangle,

pictureBox1.Location.X, pictureBox1.Location.Y,

myImage2.Width, myImage2.Height,

GraphicsUnit.Pixel, myImageAttributes);

}

, Timer ( ). Form1.cs , .

67.5. Timer.

private void timer1_Tick(object sender, EventArgs e)

{

//

// myColorMatrix ColorMatrix

// myRandom

//

// NextDouble,

// 0,0 1,0:

if (Alpha < 0 )

if (Alpha > 1)

{

Step_of_Color = Step_of_Color * (-1);

myColorMatrix.Matrix01 =

Convert.ToSingle(myRandom.NextDouble());

myColorMatrix.Matrix12 =

Convert.ToSingle(myRandom.NextDouble());

myColorMatrix.Matrix23 =

Convert.ToSingle(myRandom.NextDouble());

}

// :

Alpha = Alpha + Step_of_Color;

myColorMatrix.Matrix33 = Alpha;

// :

this.Refresh();

}

Interval Timer Value TrackBar, TrackBar . Form1.cs , .