将图像转换为字符串 [英] Convert an image to String

查看:61
本文介绍了将图像转换为字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在打开图像并尝试将其转换为字符串,因此以后我可以在1英寸和0英寸的位置显示它.我可以在OpenFileDialog中做到这一点,但是当我使用FileStream时,我会上线:

I am opening an image and trying to convert it to a string, so later I can be able to display it in 1''s and 0''s. I am able to this in OpenFileDialog but when I am using the FileStream I am getting on line:

img = new Bitmap(stream.ToString());


FileStream stream = new FileStream(Application.StartupPath + @"\TestData\img001-001.png", FileMode.Open);

myImage.Image = Image.FromStream(stream); //display in pictureBox
img = new Bitmap(stream.ToString());

推荐答案

确定解决问题

img =新的位图(流);
Ok manage to solve the problem

img = new Bitmap(stream);


这篇关于将图像转换为字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆