在图片框中显示三个字节数组(display three array of byte in picture box)

编程入门 行业动态 更新时间:2024-10-26 14:31:59
在图片框中显示三个字节数组(display three array of byte in picture box)

我有三个字节存储三种颜色(红色,绿色,蓝色),如何在c#中的图片框中显示这个数组,文件类型是图像的位图文件

byte[,] R=new byte[width, height]; byte[,] G=new byte[width, height]; byte[,] B=new byte[width, height];

这三个数组都不是空的,每个数组中都有数据存储。

I have three array of byte stored three colors (Red, Green, Blue), how can I display this array in picture box in c#, and type of file is bitmap file for image

byte[,] R=new byte[width, height]; byte[,] G=new byte[width, height]; byte[,] B=new byte[width, height];

these three array are not empty ,there are data stored in each array.

最满意答案

你意思是:

Bitmap bmp = new Bitmap(width,height); for(int i=0;i<width;i++) for(int j=0;j<height;j++) { SetPixel(i,j,Color.FromArgb(R[i,j],G[i,j],B[i,j])); } picturebox.image=bmp;

You mean:

Bitmap bmp = new Bitmap(width,height); for(int i=0;i<width;i++) for(int j=0;j<height;j++) { SetPixel(i,j,Color.FromArgb(R[i,j],G[i,j],B[i,j])); } picturebox.image=bmp;

更多推荐

本文发布于:2023-08-07 15:36:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1464903.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:数组   字节   框中   图片   display

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!