Results 1 to 4 of 4

Thread: How do i read text from an image file?

  1. #1
    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?

  2. #2
    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

  3. #3
    Join Date
    Jan 2008
    Posts
    1,521

    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.

  4. #4
    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..?

Similar Threads

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

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,711,667,829.06812 seconds with 17 queries