unrecognized or unsupported array type exception in C# [duplicate]
Possible Duplicate:
Image conversion in OpenCV C#
WeightedImg.Bitmap.SetPixel(x, y,Color.FromArgb((int)Math.Ceiling(color * R),
(int)Math.Ceiling(color * G),(int)Math.Ceiling(color * B)));
this line of code produces the exception above开发者_如何学C .. any one knows the solution ? and what does the exception mean? thanks a lot
You need to set the alphachannel, as in *A*rgb The alphachannel set's the transparency of the color
you really need to give us more to work on. how are those variables defined? what's the exception and stack trace print? this equivalent of what you're posting, for example, works as a charm on my machine
Bitmap b = new Bitmap("somefile.bmp");
double color = 1, R = 2, G = 3, B = 4;
int x = 1, y = 1;
b.SetPixel(x, y, Color.FromArgb((int)Math.Ceiling(color * R), (int)Math.Ceiling(color * G), (int)Math.Ceiling(color * B)));
精彩评论