如何使用C#windows窗体将图像转换为文本文件? [英] how to convert image into text file using C# windows form?
本文介绍了如何使用C#windows窗体将图像转换为文本文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
PLZ帮我怎么做这个应用.. ??
plz help me how to do this application..??
推荐答案
试试这个
try this
private void Form1_Load(object sender, EventArgs e)
{
byte[] imageArray = System.IO.File.ReadAllBytes(@"F:\WebApplication1\WindowsFormsApplication1\eMeditime_logo_edited.png");
string base64ImageRepresentation = Convert.ToBase64String(imageArray);
using (StreamWriter writer = new StreamWriter(@"F:\ccon\abc.txt", true))
{
writer.Write(base64ImageRepresentation);
writer.Flush();
writer.Close();
}
}
试试这个: http://stackoverflow.com/questions/17874733/converting-image-to-base64 [ ^ ]
它会将图像转换为base64但不会从图像中提取数据以执行您需要的OCR
Try this : http://stackoverflow.com/questions/17874733/converting-image-to-base64[^]
It will convert a image to base64 but will not extract data from image to do same you required OCR
这篇关于如何使用C#windows窗体将图像转换为文本文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文