DM QR Code identification Library Dmdecoder using--MFC routines

Source: Internet
Author: User

DM Code and QR code is the mainstream of the two-dimensional code, in which the QR code capacity, capacity density for 16KB,DM code capacity to a smaller size, can be encoded in only the area of 25mm² 30 numbers, but DM code fault tolerance is higher, so the actual industrial production often use DM code as a product label.

Dmdecoder is a more useful DM code parsing software, including a DLL and a lib, using this library is also easier we first look at the composition

The first step in using the library is to import the library path and library functions as follows

//Import DLL#defineDll_export __declspec (dllexport)extern "C"Dll_exportint_stdcall Datamatrix_decode (Const Char*filename); //Datamatrix_decode_rt---real-time processing of images captured by the device//imageData: Pointer to image data area (24-bit bitmap)//Width : Image width//Height : Image Heightextern "C"Dll_exportint_stdcall Datamatrix_decode_rt (unsignedChar* ImageData,intWidthintheight); extern "C"Dll_exportint_stdcall Datamatrix_output (unsignedChar* message);

And the decoding process is like this.

Char* File = (Char*)malloc(Sourcefilepath.getlength () +1);//image path to decode         for(inti =0; I < Sourcefilepath.getlength (); i++) {File[i]=Sourcefilepath.getat (i); } file[sourcefilepath.getlength ()]=0; intLength = Datamatrix_decode (file);//decodes and returns the code word length (returns 1 if decoding fails)        if(length>0) {unsignedChar* Message = (unsignedChar*)malloc(sizeof(Char) * (length+1)); Datamatrix_output (message);//Save the decoded code word to the arrayMessage[length] =0;            Convertstring.empty (); Convertstring.appendformat ("%s", message);            CString Show; Show.            Empty (); Show= Convertstring.left (Convertstring.getlength ()- A); ((CEdit*) GetDlgItem (Idc_edit_covert_result))SetWindowText (show);  Free(message); }    

The complete MFC project is as follows

Notice that the copyright mark on the tail tonxong.com removed.

Project path

http://download.csdn.net/detail/dengrengong/8608187

DM QR Code identification Library Dmdecoder using--MFC routines

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.