#include #include // // U08 *OutBuff, U16 cRows, U16 cColumns, U08 MSize #include "dm200.h" #include "QImage" #include "QDebug" #define MAX_WIDTH_BYTE 48 // 384/8 char DataMatrixdDraw(U08 *OutBuff, U16 cRows, U16 cColumns, U08 MSize); //char DataMatrixdDrawImg(U08 *OutBuff, U16 cRows, U16 cColumns, U08 MSize,QImage *pImg); void Draw_Matrix(unsigned char *buffer) { U16 sColumns, sRows; U08 *Grid; sColumns = sRows = 0; Grid = 0; sColumns = sRows = 0; short sizeType = 0; Grid = iec16022ecc200((short*)&sRows, (short*)&sColumns, buffer, &sizeType); DataMatrixdDraw(Grid,sRows,sColumns,2); } char DataMatrixdDraw(U08 *OutBuff, U16 cRows, U16 cColumns, U08 MSize) { int Size=MSize; int w = cColumns*Size; int h = cRows*Size; //qDebug()<fill(0x00ffffff); /* data */ int margin=0; U08 *p = OutBuff; int ypos=0;//margin * Size; int xpos=0; int x,y,xx,yy,bit; for(y=0; ysetPixel(xpos,h-1-(ypos+yy),0xff000000); } } xpos++; } p++; bit--; if(bit < 0) { //q++; bit = 7; } } ypos+=Size; } img->save("Myqr.bmp"); return 0; }