Skip to content

Decode failure. #41

@MartinDavidWaller

Description

@MartinDavidWaller

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions