Microsoft.Protocols.TestSuites.Rdpegfx.RdpegfxTestUtility.DrawImageWithUniqueColor C# (CSharp) Method

DrawImageWithUniqueColor() public static method

Draw a bitmap with each pixel has unique color. The image is only used for clearcode subcodec test, and the pixel number in image can't exceed 128.
public static DrawImageWithUniqueColor ( int w, int h, Color startColor ) : Bitmap
w int Width of image
h int Height of image
startColor Color The start color to draw image
return System.Drawing.Bitmap
        public static Bitmap DrawImageWithUniqueColor(int w, int h, Color startColor)
        {
            Bitmap bitmap = new Bitmap(w, h);
            int argb = startColor.ToArgb();
            for (int y = 0; y < h; y++)
            {
                for (int x = 0; x < w; x++)
                {
                    Color c = Color.FromArgb(argb);
                    bitmap.SetPixel(x, y, c);
                    argb++;                // Change color for next pixel
                }
            }

            return bitmap;
        }