-
Notifications
You must be signed in to change notification settings - Fork 156
Open
Description
Hi,
I'm having trouble getting the library to decode the attached image - or indeed any image.
My code is quite simple:
// Load the image
GdiplusStartupInput gdiplusStartupInput;
ULONG_PTR gdiplusToken;
GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL);
HBITMAP mBkgImg = mLoadImage(L"i:\\RedTitan\\Test002.png");
BITMAP bm2 = { 0 };
GetObject(mBkgImg, sizeof(bm2), &bm2);
LONG cx2 = bm2.bmWidth;
LONG cy2 = bm2.bmHeight;
GdiplusShutdown(gdiplusToken);
DmtxImage* img = dmtxImageCreate((unsigned char *)bm2.bmBits, bm2.bmWidth, bm2.bmHeight, DmtxPack32bppBGRX);
DmtxDecode* dec = dmtxDecodeCreate(img, 1);
dmtxDecodeSetProp(dec, DmtxPropImageFlip, DmtxFlipNone);
DmtxRegion* reg = dmtxRegionFindNext(dec, NULL);
if (reg != NULL) {
DmtxMessage* msg = dmtxDecodeMatrixRegion(dec, reg, DmtxUndefined);
All seem to be going well, all the objects are returned as expected but msg is always returned as NULL.
I wonder if I am missing an important step but looking at the samples that I have found all seems fine!
Any suggestions would be much appreciated.
Martin
Metadata
Metadata
Assignees
Labels
No labels
