【www.gdgbn.com--php常用代码】

我们是要求把图片image转换成byte二进制形式的,下面来看看转换的代码吧。相对很简单的。

system.io.memorystream ms = new memorystream();
                    this.pcbequipment.image.save(ms, system.drawing.imaging.imageformat.jpeg);
                    byte[] img = new byte[ms.length];
                    ms.position = 0;
                    ms.read(img, 0, convert.toint32(ms.length));
                    ms.close();

本文来源:http://www.gdgbn.com/jiaocheng/29011/