Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decode failure. #41

Open
MartinDavidWaller opened this issue Apr 9, 2021 · 0 comments
Open

Decode failure. #41

MartinDavidWaller opened this issue Apr 9, 2021 · 0 comments

Comments

@MartinDavidWaller
Copy link

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

Test002

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant