Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 05-11-2009
Member
 
Join Date: Oct 2009
Posts: 5
How do i read text from an image file?

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?
Reply With Quote
  #2  
Old 05-11-2009
Member
 
Join Date: Oct 2009
Posts: 7
Re: How do i read text from an image file?

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
Reply With Quote
  #3  
Old 05-11-2009
Member
 
Join Date: Jan 2008
Posts: 1,515
Re: How do i read text from an image file?

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;
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);
        }
    }
hope this helps.
Reply With Quote
  #4  
Old 05-11-2009
Member
 
Join Date: Oct 2009
Posts: 5
Re: How do i read text from an image file?

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..?
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "How do i read text from an image file?"
Thread Thread Starter Forum Replies Last Post
How to read Text File in Excel via VBA Rish!On MS Office Support 7 02-02-2012 04:51 PM
How to read image file in java? Juaquine Software Development 7 01-04-2011 05:15 PM
How to convert image text into a text file Wadee Windows Software 5 02-12-2010 06:33 PM
How to read string from a given text file using C# program? Kasper Software Development 5 25-02-2010 10:18 PM
Read ISO Image File Renfred Operating Systems 3 10-02-2009 11:23 PM


All times are GMT +5.5. The time now is 01:15 AM.