Reputation: 1055
I'm displaying a histogram for a grayscale image and I would like to draw each line with its respective color. For example:
for(int i=0;i<256;i++)
{
Color c=getcolor(i);
drawline(c,x,y,...);
}
I want something like the getcolor function above.
Upvotes: 2
Views: 2149
Reputation: 112807
private static Color getcolor(int grayScale)
{
return Color.FromArgb(grayScale, grayScale, grayScale);
}
Upvotes: 5