Просмотр исходного кода

热敏打印图片的,还要调整

张洋 6 лет назад
Родитель
Сommit
b475dcc3d5

BIN
bin/Win32/Debug/lewaimai_pos_windows.zip


BIN
bin/x64/Release/lewaimai_pos_windows_server_linux/lewaimai_pos_windows_server_linux


+ 2 - 1
lewaimai_pos_windows/pch/pch.h

@@ -45,7 +45,7 @@ using namespace std;
  **/
 #ifdef _WIN32
 #include <windows.h>
-#include<io.h>
+#include <io.h>
 #include <ShellAPI.h>
 #else
 #include <unistd.h>
@@ -64,6 +64,7 @@ using namespace std;
 #include <DuiLib/UIlib.h>
 using namespace DuiLib;
 
+//资源文件
 #include "../resource/resource.h"
 
 //json库

Разница между файлами не показана из-за своего большого размера
+ 854 - 551
lewaimai_pos_windows/tool/CPosPrinter.cpp


+ 6 - 2
lewaimai_pos_windows/tool/CPosPrinter.h

@@ -3,6 +3,9 @@
 #include "../pch/pch.h"
 #include "../order/CWaimaiOrder.h"
 
+#include <gdiplus.h>
+using namespace Gdiplus;
+
 //SetupDiGetInterfaceDeviceDetail所需要的输出长度,定义足够大
 #define INTERFACE_DETAIL_SIZE 1024
 
@@ -50,7 +53,7 @@ private:
 	int GetPrinterType(wstring vid, wstring pid);
 
 	int WriteData(string meg);
-	int WriteBuf(const char* buf, int len);
+	int WriteBuf(const unsigned char* buf, int len);
 
 	//端口连通性测试
 	bool PortTest(HANDLE hPort);
@@ -68,7 +71,8 @@ private:
 
 	int POS_TextOut(string abc, bool is_double_width = false, bool is_double_height = false, int align_type = 0);
 	int POS_CutPaper();
-	int POS_OutQRCode();
+	int POS_OutQRCode(std::string data);
+	void PrintBmp(Bitmap* bmp);
 
 	//标签打印机的处理方法
 	void BIAOQIAN_Reset();