I was just wondering, as we can edit images to get what we desired, is there something that could get me some text that is on an image?
I was just wondering, as we can edit images to get what we desired, is there something that could get me some text that is on an image?
Hi, am wondering as to what are you trying to do. If you want to edit an image, you can very well use any third party software like photoshop or Microsoft Imaging editor or something. But i do not think you can code such a thing, and if at all coded, it will be very tedious i suppose. And yes if someone has got only the text out of the image, by something or the other, i would also like to know how was that done. Thanks in advance
You can use Microsoft Document Imaging API for that matter. Just add a reference to the Microsoft Document Imaging 12.0 Type Library by using "Add Reference".In the code, textbox1 is the textbox that you get the image's path and textbox2 is the textbox that you write text on the picture. You can use the following code there;
hope this helps.Code:public partial class Demo1 : Form { MODI.Document insDoc; public Demo1() { InitializeComponent(); insDoc = new MODI.Document(); } private void btnGetImage_OnClick(object sender, EventArgs e) { openFileDialog1.ShowDialog(); if (openFileDialog1.FileName != " ") { textbox1.Text = openFileDialog1.FileName; } } private void btnGetText_OnClick(object sender, EventArgs e) { insDoc.Create(textbox1.Text); insDoc.OCR(MODI.MiLANGUAGES.miLANG_ENGLISH, true, true); foreach (MODI.Image insImage in insDoc.Images) { MODI.Layout layout = insImage.Layout; textbox2.Text = layout.Text; } insDoc.Close(false); } }
Hey that is cool. Will try this. but have one more thing for you. I see that you have included the textbox space from which to catch the text. but can you tell me how we can navigate in the image. I mean if i have to locate the the co ordinates as such of the text location, how will i do that..?
Bookmarks