开发者

unrecognized or unsupported array type exception in C# [duplicate]

This question already has answers here: Closed 11 years ago.

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)));
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜