From 8f2e7852a849be571b97eed2e5def1a5451dabf9 Mon Sep 17 00:00:00 2001 From: Jos Groot Lipman Date: Tue, 23 Sep 2025 10:04:23 +0000 Subject: [PATCH] UWVA#90681 Achtergrond van QR-codes instelbaar maken (nu hardcoded wit) svn path=/Slnkdwf/trunk/; revision=70390 --- SlnkDWFCom/QRCode.cpp | 22 ++++++++++++++++++---- SlnkDWFCom/QRCode.h | 4 ++++ SlnkDWFCom/SLNKDWF.idl | 2 ++ SlnkDWFCom/SLNKDWFVersion.h | 2 +- historie.txt | 5 ++++- 5 files changed, 29 insertions(+), 6 deletions(-) diff --git a/SlnkDWFCom/QRCode.cpp b/SlnkDWFCom/QRCode.cpp index 84a66cb..ba7243d 100644 --- a/SlnkDWFCom/QRCode.cpp +++ b/SlnkDWFCom/QRCode.cpp @@ -8,7 +8,7 @@ STDMETHODIMP CQRCode::InterfaceSupportsErrorInfo(REFIID riid) { - static const IID* arr[] = + static const IID* arr[] = { &IID_IQRCode }; @@ -70,14 +70,14 @@ bool CQRCode::CreateCxImage(CxImage *img) { CQR_Encode* pQR_Encode = new CQR_Encode; - BOOL res = pQR_Encode->EncodeData(m_nLevel, m_nVersion, - m_bAutoExtend, m_nMaskingNo, + BOOL res = pQR_Encode->EncodeData(m_nLevel, m_nVersion, + m_bAutoExtend, m_nMaskingNo, m_Text ); if (!res) return false; img->Create((pQR_Encode->m_nSymbleSize+2*QR_MARGIN), (pQR_Encode->m_nSymbleSize+2*QR_MARGIN), 24 /* bpp */); - img->Clear(255); + img->Clear(m_BgGrayColor); img->SetTransIndex(-1); for (int i = 0; i < pQR_Encode->m_nSymbleSize; ++i) for (int j = 0; j < pQR_Encode->m_nSymbleSize; ++j) @@ -214,3 +214,17 @@ STDMETHODIMP CQRCode::put_Color(LONG newVal) return S_OK; } + +STDMETHODIMP CQRCode::get_BgGrayColor(BYTE* pVal) +{ + *pVal = m_BgGrayColor; + + return S_OK; +} + +STDMETHODIMP CQRCode::put_BgGrayColor(BYTE newVal) +{ + m_BgGrayColor = newVal; + + return S_OK; +} diff --git a/SlnkDWFCom/QRCode.h b/SlnkDWFCom/QRCode.h index 421f868..5f163bd 100644 --- a/SlnkDWFCom/QRCode.h +++ b/SlnkDWFCom/QRCode.h @@ -30,6 +30,7 @@ public: m_nMaskingNo = -1; // Auto m_nSize = 8; // pixels/module m_Color = 0x000000; // zwart + m_BgGrayColor = 0xFF; // wit } DECLARE_REGISTRY_RESOURCEID(IDR_QRCODE) @@ -62,6 +63,7 @@ private: BOOL m_bAutoExtend; int m_nLevel; int m_Color; + int m_BgGrayColor; int m_nSize; bool CreateCxImage(CxImage* img); HRESULT StreamPNG(CxImage &img, VARIANT *ImageData, BOOL bPNG); @@ -83,6 +85,8 @@ public: STDMETHOD(put_Size)(LONG newVal); STDMETHOD(get_Color)(LONG* pVal); STDMETHOD(put_Color)(LONG newVal); + STDMETHOD(get_BgGrayColor)(BYTE* pVal); + STDMETHOD(put_BgGrayColor)(BYTE newVal); }; OBJECT_ENTRY_AUTO(__uuidof(QRCode), CQRCode) diff --git a/SlnkDWFCom/SLNKDWF.idl b/SlnkDWFCom/SLNKDWF.idl index 283406b..a384b5d 100644 --- a/SlnkDWFCom/SLNKDWF.idl +++ b/SlnkDWFCom/SLNKDWF.idl @@ -395,6 +395,8 @@ interface IQRCode : IDispatch{ [propput, id(7), helpstring("property Size")] HRESULT Size([in] LONG newVal); [propget, id(8), helpstring("property Color")] HRESULT Color([out, retval] LONG* pVal); [propput, id(8), helpstring("property Color")] HRESULT Color([in] LONG newVal); + [propget, id(9), helpstring("property BgGrayColor")] HRESULT BgGrayColor([out, retval] BYTE* pVal); + [propput, id(9), helpstring("property BgGrayColor")] HRESULT BgGrayColor([in] BYTE newVal); }; [ object, diff --git a/SlnkDWFCom/SLNKDWFVersion.h b/SlnkDWFCom/SLNKDWFVersion.h index 8feeb07..571259b 100644 --- a/SlnkDWFCom/SLNKDWFVersion.h +++ b/SlnkDWFCom/SLNKDWFVersion.h @@ -1,6 +1,6 @@ // Zorg dat versies alfabetisch altijd op elkaar volgen! #define SLNK_MAJOR_VERSION 4 -#define SLNK_MINOR_VERSION 40 +#define SLNK_MINOR_VERSION 41 #define SLNK_BUILD_VERSION 0 // Define resource strings diff --git a/historie.txt b/historie.txt index 4c71d9f..1338a93 100644 --- a/historie.txt +++ b/historie.txt @@ -1,4 +1,7 @@ -V4.30 23-08-2022 +V4.41 23-09-2025 + - UWVA#90681 Achtergrond van QR-codes instelbaar maken via BgGrayColor + +V4.40 17-06-2024 - Visual Studio 2022 - SZDB#82496 plaatjes verkleinen met Resample2 ipv. Resample - CIZN#82871 tekeningen met zwarte lijnen forceren (whipfile.forcePlanColor)