Dear Sir/Madam,

I am having an error in my code if i try to get an image as Black & White colored. My file is a one page (tif) file in format : "Tiff Black White Ccitt Group4" Thanks in advance. Here is my code :

 private static void convertToBlackWhite(FRDocument frDoc)
        {
          int pagesCount = frDoc.Pages.Count;
          Bitmap[] blackWhiteImg = new Bitmap[pagesCount];
          for (int i = 0; i < pagesCount; i++)
          {
            FRPage page = frDoc.Pages[i];
            ImageDocument imageDoc = page.ImageDocument;
            FREngine.Image image = imageDoc.BlackWhiteImage;
            IntPtr hBitmap = (IntPtr)image.GetPicture(null, 0);
            blackWhiteImg[i] = System.Drawing.Image.FromHbitmap(hBitmap);//this line throws error
            blackWhiteImg[i].SetResolution(image.XResolution, image.YResolution);
            Gdi32Helper.DeleteObject(hBitmap);
          }
        //other codes..
    }

asked 21 Dec '16, 16:59

hakanaktan's gravatar image

hakanaktan
2717

I have found something in document : FREngine 10 UserGuide In page 1027 in table i see the text below. It is about "IImage::GetPicture"

A remark has been added. These methods do not work if the Engine object is created using the OutprocLoader object.

I am using OutProcLoader. Is there an alternative way of GetPicture method for OutProcLoader?

(21 Dec '16, 17:38) hakanaktan

Hi Hakan

As you rightly pointed out according to the help method IImage::GetPicture does not work if the Engine object is created using the OutprocLoader object. The only way to get an image in FineReader Engine 10.5 is to use IImage::WriteToFile method.

link

answered 23 Dec '16, 16:20

Diana%20Khammatova's gravatar image

Diana Khamma... ♦♦
362

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×1
×1
×1

Asked: 21 Dec '16, 16:59

Seen: 159 times

Last updated: 23 Dec '16, 16:20

Related questions

© 2016 ABBYY. All rights Reserved. www.ABBYY.com | Privacy Policy | Legal