I found information about how to fade images on the net. But it is extremely slow. Here is the code:
IA is an ImageAttributes variable. matrixEl is the float value that is incremented to fade in the image.
The code returns the IA and I use a bitmap graphics object to draw it over and over. This method is extremly slow. Is there a much faster way to fade images in and out?
IA is an ImageAttributes variable. matrixEl is the float value that is incremented to fade in the image.
C#:
float[][] colorMatrixElements = {
new float[] {1.0f, 0.0f, 0.0f, 0.0f, 0.0f},
new float[] {0.0f, 1.0f, 0.0f, 0.0f, 0.0f},
new float[] {0.0f, 0.0f, 1.0f, 0.0f, 0.0f},
new float[] {0.0f, 0.0f, 0.0f, matrixEl, 0.0f},
new float[] {0.0f, 0.0f, 0.0f, 0.0f, 1.0f}
};
ColorMatrix wmColorMatrix = new ColorMatrix(colorMatrixElements);
IA.SetColorMatrix(wmColorMatrix, ColorMatrixFlag.Default, ColorAdjustType.Bitmap);
return IA;