gsm Posted June 6, 2013 Share Posted June 6, 2013 sorry PNG to text decode possible? 6.php Link to comment https://forums.phpfreaks.com/topic/278859-png-to-text-decode-possible/ Share on other sites More sharing options...
Psycho Posted June 6, 2013 Share Posted June 6, 2013 Yes, you would need get an external OCR (Optical Character Recognition) component and call that from within PHP. I don't believe there is any OCR readers built to be run just within PHP. Link to comment https://forums.phpfreaks.com/topic/278859-png-to-text-decode-possible/#findComment-1434507 Share on other sites More sharing options...
gsm Posted June 8, 2013 Author Share Posted June 8, 2013 Yes, you would need get an external OCR (Optical Character Recognition) component and call that from within PHP. I don't believe there is any OCR readers built to be run just within PHP. what about this code? private string ConvertImage(Bitmap sBit) { MemoryStream imageStream = new MemoryStream(); //sBit.Save(imageStream, ImageFormat.Jpeg); sBit.Save(imageStream, System.Drawing.Imaging.ImageFormat.Png); return Convert.ToBase64String(imageStream.ToArray()); } private void button1_Click(object sender, EventArgs e) { Bitmap sBit = new Bitmap(@"C:\abc.png"); string imageString = ConvertImage(sBit); // StreamWriter sw = new StreamWriter(@"C:\waleedelkot.text", false); StreamWriter sw = new StreamWriter(@"C:\wal.doc", false); sw.Write(imageString); sw.Close(); MessageBox.Show("success"); } Link to comment https://forums.phpfreaks.com/topic/278859-png-to-text-decode-possible/#findComment-1434876 Share on other sites More sharing options...
boompa Posted June 8, 2013 Share Posted June 8, 2013 That's not PHP code, it's C# code. And it converts an image to a base-64 representation. If that's all you want then you can use base64_encode; check out this comment on that page. Link to comment https://forums.phpfreaks.com/topic/278859-png-to-text-decode-possible/#findComment-1434889 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.