Thanks for your reply. I will try those APIs. Saving image into disk and reading back is not preferred since it will affect the performance. I would like to process it in memory rather than read from IO. Thanks.
On Wednesday, January 2, 2013 5:11:53 PM UTC+7, TP wrote: > > On Wed, Jan 2, 2013 at 1:37 AM, TP <win...@gmail.com <javascript:>> > wrote: > > On Wed, Jan 2, 2013 at 12:15 AM, newbie <duon...@gmail.com <javascript:>> > wrote: > >> Hello experts, > >> > >> I would like to create a Pix of Leptonica from my HBITMAP which was > captured > >> from the screen shot.Could you please advise me how to create it? > > > > See pixGetWindowsHBITMAP() in leptonica/src/leptwin.c [1] > > > > [1] http://tpgit.github.com/Leptonica/leptwin_8c_source.html#l00276 > > Oops. I just re-read your message and you want to go from HBITMAP to > Pix, not the other way around. I never got around to writing that > routine, but using the various static "helper" functions in leptwin.c > and pixCreate() [1], pixSetData() [2], and possibly pixSetColorMap() > [3] and pixEndianByteSwap() [4] this should be reasonably "simple" --- > assuming you are familiar with the internal structure of hbitmaps. > Reading dibsectn.c [5], which the guts of leptwin.c was based on, may > or may not help. > > Otherwise your easiest course is to just write the HBITMAP to disk as > TIFF or PNG and then read it back in. > > [1] http://tpgit.github.com/Leptonica/pix1_8c_source.html#l00269 > > [2] http://tpgit.github.com/Leptonica/pix1_8c_source.html#l01376 > > [3] http://tpgit.github.com/Leptonica/pix1_8c_source.html#l01312 > > [4] http://tpgit.github.com/Leptonica/pix2_8c_source.html#l02283 > > [5] http://shito.servebeer.com/pub/study/win32app/_tips/_DIBSectn.c > -- You received this message because you are subscribed to the Google Groups "tesseract-ocr" group. To post to this group, send email to tesseract-ocr@googlegroups.com To unsubscribe from this group, send email to tesseract-ocr+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/tesseract-ocr?hl=en