Jump to content

png to text decode possible?


gsm

Recommended Posts

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");
}

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.