Commit b206e195 by yunpeng.song

增加打印图片功能

parent 79266932
...@@ -700,20 +700,6 @@ bool _LoadPosdll(void) ...@@ -700,20 +700,6 @@ bool _LoadPosdll(void)
BPLA_PrintMaxiEx = (mBPLA_PrintMaxiEx) GetProcAddress(g_bplaLog,"BPLA_PrintMaxiEx"); BPLA_PrintMaxiEx = (mBPLA_PrintMaxiEx) GetProcAddress(g_bplaLog,"BPLA_PrintMaxiEx");
POS_S_DownloadAndPrintBmp VC_POS_S_DownloadAndPrintBmp = NULL;
POS_S_PrintBmpInRAM VC_POS_S_PrintBmpInRAM = NULL;
POS_S_PrintBmpInFlash VC_POS_S_PrintBmpInFlash = NULL;
POS_S_SetBarcode VC_POS_S_SetBarcode = NULL;
POS_S_SetAlignMode VC_POS_S_SetAlignMode = NULL;
/*******只支持页打印模式(P)或标签打印模式(L)的函数*******/
POS_PL_SetArea VC_POS_PL_SetArea = NULL;
POS_PL_TextOut VC_POS_PL_TextOut = NULL;
if(BPLA_PrintMaxiEx == NULL) if(BPLA_PrintMaxiEx == NULL)
{ {
return false; return false;
...@@ -1206,7 +1192,7 @@ bool _UnloadLogdll(void) ...@@ -1206,7 +1192,7 @@ bool _UnloadLogdll(void)
return false; return false;
} }
FreeLibrary(g_hLog); FreeLibrary(g_hLog);
VC_Log_WriteLog(1,"%s","LogDLL卸载完成"); //VC_Log_WriteLog(1,"%s","LogDLL卸载完成");
return true; return true;
} }
...@@ -1844,7 +1830,8 @@ void GetProfilePath(char *CONFIGFILE) ...@@ -1844,7 +1830,8 @@ void GetProfilePath(char *CONFIGFILE)
ptrlen = ptr-path; ptrlen = ptr-path;
memcpy(&path[ptrlen+1], "printer.ini", 12); memcpy(&path[ptrlen+1], "printer.ini", 12);
path[ptrlen+12] = 0; path[ptrlen+12] = 0;
strcpy_s(CONFIGFILE,(size_t)strlen(CONFIGFILE), path); strcpy_s(CONFIGFILE,256, path);
//strcpy(CONFIGFILE,path);
printf("配置文件路径: %s\n", CONFIGFILE); printf("配置文件路径: %s\n", CONFIGFILE);
} }
...@@ -2384,3 +2371,21 @@ void _FreeLine() ...@@ -2384,3 +2371,21 @@ void _FreeLine()
{ {
VC_POS_FeedLine(); VC_POS_FeedLine();
} }
bool _PrintBmp(char pszPath[], int nOrgx, int nMode,int alignMode)
{
VC_Log_WriteLog(1,"图片路径: %s %d",pszPath,alignMode);
VC_POS_S_SetAlignMode(alignMode);
int result = VC_POS_S_DownloadAndPrintBmp(pszPath,nOrgx,nMode);
if(result == POS_SUCCESS )
{
VC_Log_WriteLog(1,"打印图片成功");
VC_POS_FeedLine();
return true;
}
else
{
VC_Log_WriteLog(1,"打印图片失败 %d ",result);
return false;
}
}
\ No newline at end of file
...@@ -392,6 +392,8 @@ bool _PrintLine(char data[], int fontType,int fontStyle ,int width,int height,in ...@@ -392,6 +392,8 @@ bool _PrintLine(char data[], int fontType,int fontStyle ,int width,int height,in
bool _PrintBarCode(char data[],int type, int leftMargin,int fontType ,int width,int height,int position);//打印条码 bool _PrintBarCode(char data[],int type, int leftMargin,int fontType ,int width,int height,int position);//打印条码
bool _PrintQRCode(char data[], int type, int leftMargin,int width);//打印行 bool _PrintQRCode(char data[], int type, int leftMargin,int width);//打印行
bool _PrintBmp(char pszPath[], int nOrgx, int nMode, int alignMode);
void _FreeLine(); void _FreeLine();
void _InPrint2dcode(char data[]); void _InPrint2dcode(char data[]);
void OnClosePort(); void OnClosePort();
......
...@@ -178,3 +178,9 @@ extern "C" bool __declspec(dllexport)PrintQRCode(char data[], int type, int lef ...@@ -178,3 +178,9 @@ extern "C" bool __declspec(dllexport)PrintQRCode(char data[], int type, int lef
return _PrintQRCode( data, type, leftMargin,width);//打印行 return _PrintQRCode( data, type, leftMargin,width);//打印行
} }
extern "C" bool __declspec(dllexport)PrintBmp(char pszPath[], int nOrgx, int nMode, int alignMode)
{
VC_Log_WriteLog(1,pszPath);
return _PrintBmp( pszPath, nOrgx, nMode,alignMode);//打印图片
}
...@@ -14,3 +14,4 @@ EXPORTS ...@@ -14,3 +14,4 @@ EXPORTS
TSCWinPrintln @12 TSCWinPrintln @12
TSCWinPrintPage @13 TSCWinPrintPage @13
TSCInit @14 TSCInit @14
PrintBmp @15
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment