tags:

views:

57

answers:

1

First: sorry for my English from Google

The question:
I'm changing the IDE, I'm migrating from Borland to QT with QT Creator.

In Borland I used a class contained in a type library (APuma.dll). The prototype was:

        BOOL XOpen (long hDIB, LPCTSTR FileName) / / OpenOCR - Cuneiform

hDIB is a pointer to global memory of an image.
This version Not Work with files.

To pass a pointer to global memory of an image, I used GDI+, but in QT can not find anything similar, and the inclusion of Gdiplus.h and GdiPlusInit.h generates too many errors.

How do I give access to global memory where I host the image to XOpen?

Thank you very much.

+1  A: 

OK, I think i understand what you need. You need a pointer to the pixels of the image so you can pass it. Your simplest option in Qt is using a QImage object and using its bits() member.

Something like this:

QImage image(filename);
uchar* p = image.bits();
XOpen(reinterpret_cast<long>(p), whatever);

just be sure that XOpen somehow knows the dimmensions of the image. And that you have it in the right format (See QImage::convertToFormat). For more overall information check the Qt documentation at http://doc.qt.nokia.com/4.6/qimage.html

Evan Teran
Thank you very much Evan,Still not working, and probably the error is in charge of the class. This engine is of great quality but this DLL has brought me many problems.Thanks again.
Darío