Commit 77fbb803 by yunpeng.song

增加居中配置

parent 319177a6
......@@ -86,6 +86,8 @@ 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;
......@@ -456,6 +458,14 @@ bool _LoadPosdll(void)
VC_Log_WriteLog(4,"%s","VC_POS_S_SetBarcode加载失败");
return false;
}
VC_POS_S_SetAlignMode = (POS_S_SetAlignMode) GetProcAddress(g_hPosdll,"POS_S_SetAlignMode");
if(VC_POS_S_SetAlignMode == NULL)
{
VC_Log_WriteLog(4,"%s","VC_POS_S_SetAlignMode加载失败");
return false;
}
/*******只支持页打印模式(P)或标签打印模式(L)的函数*******/
VC_POS_PL_SetArea = (POS_PL_SetArea) GetProcAddress(g_hPosdll,"POS_PL_SetArea");
if(VC_POS_PL_SetArea == NULL)
......@@ -1294,7 +1304,7 @@ int PrintCloseTsc(char *page, char *num)
TSC_sendcommand("DIRECTION 1");
TSC_clearbuffer();
int i = 0;
unsigned int i = 0;
while(i < m_label_args.size())
{
......@@ -1380,7 +1390,7 @@ void deletelog(int nDays)
}
}
bool _PrintLine(char data[], int fontType,int fontStyle ,int width,int height)
bool _PrintLine(char data[], int fontType,int fontStyle ,int width,int height,int leftMargin,int alignMode)
{
int length = 0;
length = strlen(data);
......@@ -1399,14 +1409,15 @@ bool _PrintLine(char data[], int fontType,int fontStyle ,int width,int height)
VC_POS_SetLineSpacing(0);
m_first = false;
}
int linefms = LENTH_FMS_80;
if(m_printclass.m_PrintSize==80)
{
linefms = LENTH_FMS_56;
}
//int linefms = LENTH_FMS_80;
//if(m_printclass.m_PrintSize==80)
//{
// linefms = LENTH_FMS_56;
//}
//char lineData[1024]={'\0'};
//strncpy_s(lineData,sizeof(lineData), data, length);
VC_POS_S_TextOut(data, 10+LENTH_FMS+linefms, width, height, fontType,fontStyle);
VC_POS_S_SetAlignMode(alignMode);
VC_POS_S_TextOut(data, leftMargin, width, height, fontType,fontStyle);
VC_POS_FeedLine();
return true;
......@@ -1419,13 +1430,6 @@ bool _PrintBarCode(char data[],int type, int leftMargin,int fontType ,int width,
strcat_s(code,sizeof(code),data);
int len=0; // 保存数组的长度
len = strlen(code); // 计算字符数组str的长度
VC_Log_WriteLog(1,"接受到的数据长度是: %d",len);
VC_Log_WriteLog(1,"接受到的数据长度是: %d",type);
VC_Log_WriteLog(1,"接受到的数据长度是: %d",leftMargin);
VC_Log_WriteLog(1,"接受到的数据长度是: %d",fontType);
VC_Log_WriteLog(1,"接受到的数据长度是: %d",height);
VC_Log_WriteLog(1,"接受到的数据长度是: %d",width);
VC_Log_WriteLog(1,"接受到的数据长度是: %d",position);
VC_Log_WriteLog(1,"接受到的数据长度是: %s",data);
int result = VC_POS_S_SetBarcode(code, leftMargin, type, width, height,fontType, position,len);
memset(code,0x0,sizeof(code));
......
......@@ -152,6 +152,7 @@ typedef int (__stdcall *POS_Close)(void);
typedef int (__stdcall *POS_Reset)(void);
typedef int (__stdcall *POS_SetMode)(int nPrintMode);
typedef int (__stdcall *POS_S_SetAlignMode)(int nMode);
typedef int (__stdcall *POS_SetMotionUnit)(int nHorizontalMU,int nVerticalMU);
......@@ -378,7 +379,7 @@ void CheckStatus();
void _InPrintData(char data[]);
void GetProfilePath(char *CONFIGFILE);
void _GetPrintIni(char inidata[]);
bool _PrintLine(char data[], int fontType,int fontStyle ,int width,int height);//打印行
bool _PrintLine(char data[], int fontType,int fontStyle ,int width,int height,int leftMargin,int alignMode);//打印行
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);//打印行
......
......@@ -163,9 +163,9 @@ extern "C" void __declspec(dllexport)Initconfigini(char data[])
_GetPrintIni(data);
}
extern "C" bool __declspec(dllexport)PrintDataLine(char data[],int fontType,int fontStyle,int width,int height)
extern "C" bool __declspec(dllexport)PrintDataLine(char data[],int fontType,int fontStyle,int width,int height,int leftMargin,int alignMode)
{
return _PrintLine(data,fontType,fontStyle,width,height);
return _PrintLine(data,fontType,fontStyle,width,height, leftMargin, alignMode);
}
......

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fmposdll", "fmposdll.vcxproj", "{EFB2B16E-B687-DFD3-01DB-8BFCF807D36A}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fmposdll", "fmposdll.vcxproj", "{A46CE5D4-D01B-CA08-372B-B0085099921E}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test", "..\test\test.vcxproj", "{A3A3F622-F88F-47BC-9776-9B44676755DB}"
EndProject
......@@ -11,10 +11,10 @@ Global
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{EFB2B16E-B687-DFD3-01DB-8BFCF807D36A}.Debug|Win32.ActiveCfg = Debug|Win32
{EFB2B16E-B687-DFD3-01DB-8BFCF807D36A}.Debug|Win32.Build.0 = Debug|Win32
{EFB2B16E-B687-DFD3-01DB-8BFCF807D36A}.Release|Win32.ActiveCfg = Release|Win32
{EFB2B16E-B687-DFD3-01DB-8BFCF807D36A}.Release|Win32.Build.0 = Release|Win32
{A46CE5D4-D01B-CA08-372B-B0085099921E}.Debug|Win32.ActiveCfg = Debug|Win32
{A46CE5D4-D01B-CA08-372B-B0085099921E}.Debug|Win32.Build.0 = Debug|Win32
{A46CE5D4-D01B-CA08-372B-B0085099921E}.Release|Win32.ActiveCfg = Release|Win32
{A46CE5D4-D01B-CA08-372B-B0085099921E}.Release|Win32.Build.0 = Release|Win32
{A3A3F622-F88F-47BC-9776-9B44676755DB}.Debug|Win32.ActiveCfg = Debug|Win32
{A3A3F622-F88F-47BC-9776-9B44676755DB}.Debug|Win32.Build.0 = Debug|Win32
{A3A3F622-F88F-47BC-9776-9B44676755DB}.Release|Win32.ActiveCfg = Release|Win32
......
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