//接着在头文件中继续定义一个PDF417条码生成类:
/******************************************************************************
* PDF417条形码类
******************************************************************************/
class TPDF417 : public TObject
{
private:
AnsiString FValue;
AnsiString FDrawCode;
int FDrawColumns;
int FDrawRows;
int FDrawPix;
int FDrawRowHeightPix;
int FWidth;
int FHeight;
private:
void listInit(pArrayList list);
void listFree(pArrayList list);
void listAdd(pArrayList list, char type, int start, int end);
pListElement listGet(pArrayList list, int idx);
void listRemove(pArrayList list, int idx) ;
int checkElementType(pListElement p, char type);
int getElementLength(pListElement p);
void outCodeword17(pPdf417class p, int codeword) ;
void outCodeword18(pPdf417class p, int codeword) ;
void outCodeword(pPdf417class p, int codeword);
void outStopPattern(pPdf417class p) ;
void outStartPattern(pPdf417class p) ;
void outPaintCode(pPdf417class p) ;
void calculateErrorCorrection(pPdf417class p, int dest) ;
int getTextTypeAndValue(char* text, int size, int idx) ;
void textCompaction(pPdf417class p, int start, int length) ;
void basicNumberCompaction(pPdf417class p, int start, int length);
void numberCompaction(pPdf417class p, int start, int length) ;
void byteCompaction6(pPdf417class p, int start) ;
void byteCompaction(pPdf417class p, int start, int length);
void breakString(pPdf417class p, pArrayList list);
void assemble(pPdf417class p, pArrayList list);
int maxPossibleErrorLevel(int remain);
void dumpList(pPdf417class p, pArrayList list) ;
int getMaxSquare(pPdf417param p) ;
AnsiString GetBinStr(int n);
/******************************************************************************
* 转换整数为二进制数
******************************************************************************/
void paintCode(pPdf417param p);
/******************************************************************************
* 初始化PDF417条形码
******************************************************************************/
void pdf417init(pPdf417param param);
/******************************************************************************
* 释放PDF417条形码
******************************************************************************/
void pdf417free(pPdf417param param);
void setValue(AnsiString Value);
void makeDrawCode();
void setDrawPix(int pix);
void setDrawRowHeightPix(int pix);
void DrawCodeBar(TCanvas *c);
public:
TRect GetCanvasRect();
void DoCodeBar(TCanvas *canvas,AnsiString Value,int DrawPix,int RowHeightPix);
};
#endif