且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何使用C#windows窗体将图像转换为文本文件?

更新时间:2023-02-11 07:50:48

试试这个



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://***.com/questions/17874733/converting-image-to-base64 [ ^ ]



它会将图像转换为base64但不会从图像中提取数据以执行您需要的OCR
Try this : http://***.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