本文介绍了从修改后的字节数组重绘图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是吉萨,
我试图将图像读入字节数组并修改此字节数组.这我能够正确地做到.但是,当我尝试从此字节数组重绘图像时,出现错误..我知道问题所在...在这里,我尝试向图像添加秘密信息并重绘与原始图像没有太大区别的图像.

memorystream ms =新的memorystream(bt); //bt是hving的字节数组
//修改后的图片数据,例如bt [0] = bt [0] + 5;
picturebox2.image = image.fromstream(ms); //错误:无效的参数

Hi this is geetha,
i am trying to read the image into byte array and modifying this byte array. this i am able to do correctly. but when i try to redraw the image from this byte array it is giving an error.. my i know the problem... Here I am trying to add secrete information to the image and redraw the image with no much difference from the original.

memorystream ms=new memorystream(bt); // bt is the byte array hving
//modified image data like bt[0]=bt[0]+ 5;
picturebox2.image=image.fromstream(ms); // error: invalid argumen

推荐答案


sursangeetha写道:
sursangeetha wrote:

///修改后的图像数据,例如bt [0] = bt [0] + 5;

//modified image data like bt[0]=bt[0]+ 5;



1.您要修改字节数组的逻辑是什么?
2.修改图像字节数组的原因是什么?之后有什么用吗?

顺便说一句:看起来您正在尝试将整数添加到某个字节数组.它们不是整数(不是10的基数)!可能导致数组损坏.



1. On what logic you are modifying the byte array?
2. Whats the reason behind modifying an image byte array. Is it of any use after it?

Btw: Looks like you are trying to add an integer to a certain byte array. They are not integers(=> not a base 10)! Probably leading to a corrupt array.


这篇关于从修改后的字节数组重绘图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-23 21:37