UWVA#90681 Achtergrond van QR-codes instelbaar maken (nu hardcoded wit)

svn path=/Slnkdwf/trunk/; revision=70390
This commit is contained in:
Jos Groot Lipman
2025-09-23 10:04:23 +00:00
parent 6e502e509d
commit 8f2e7852a8
5 changed files with 29 additions and 6 deletions

View File

@@ -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;
}

View File

@@ -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)

View File

@@ -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,

View File

@@ -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

View File

@@ -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)