public static DrawImageWithUniqueColor ( int w, int h, Color startColor ) : |
||
w | int | Width of image |
h | int | Height of image |
startColor | Color | The start color to draw image |
return |
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;
}