2.81 FSN#22618 QRCodes kunnen ook in kleur

svn path=/Slnkdwf/trunk/; revision=12536
This commit is contained in:
Jos Groot Lipman
2012-02-28 08:32:38 +00:00
parent 95953f2e01
commit 200ea1b237
4 changed files with 22 additions and 2 deletions

View File

@@ -84,7 +84,7 @@ bool CQRCode::CreateCxImage(CxImage *img)
{
if (pQR_Encode->m_byModuleData[i][j])
{
img->SetPixelColor(i + QR_MARGIN, pQR_Encode->m_nSymbleSize - j + QR_MARGIN - 1, RGB(0, 0, 0));
img->SetPixelColor(i + QR_MARGIN, pQR_Encode->m_nSymbleSize - j + QR_MARGIN - 1, m_Color);
}
}
img->Resample(m_nSize * img->GetWidth(), m_nSize * img->GetHeight());
@@ -200,3 +200,17 @@ STDMETHODIMP CQRCode::put_Size(LONG newVal)
return S_OK;
}
STDMETHODIMP CQRCode::get_Color(LONG* pVal)
{
*pVal = m_Color;
return S_OK;
}
STDMETHODIMP CQRCode::put_Color(LONG newVal)
{
m_Color = newVal;
return S_OK;
}

View File

@@ -29,6 +29,7 @@ public:
m_nLevel = 1; // M=15%
m_nMaskingNo = -1; // Auto
m_nSize = 8; // pixels/module
m_Color = 0x000000; // zwart
}
DECLARE_REGISTRY_RESOURCEID(IDR_QRCODE)
@@ -60,6 +61,7 @@ private:
int m_nVersion;
BOOL m_bAutoExtend;
int m_nLevel;
int m_Color;
int m_nSize;
bool CreateCxImage(CxImage* img);
HRESULT StreamPNG(CxImage &img, VARIANT *ImageData, BOOL bPNG);
@@ -79,6 +81,8 @@ public:
STDMETHOD(put_Masking)(LONG newVal);
STDMETHOD(get_Size)(LONG* pVal);
STDMETHOD(put_Size)(LONG newVal);
STDMETHOD(get_Color)(LONG* pVal);
STDMETHOD(put_Color)(LONG newVal);
};
OBJECT_ENTRY_AUTO(__uuidof(QRCode), CQRCode)

View File

@@ -367,6 +367,8 @@ interface IQRCode : IDispatch{
[propput, id(6), helpstring("property Masking")] HRESULT Masking([in] LONG newVal);
[propget, id(7), helpstring("property Size")] HRESULT Size([out, retval] LONG* pVal);
[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);
};
[
uuid(B6FCDE6E-141C-4601-B3AC-4DF4D5F25DF8),

View File

@@ -1,6 +1,6 @@
// Zorg dat versies alfabetisch altijd op elkaar volgen!
#define SLNK_MAJOR_VERSION 2
#define SLNK_MINOR_VERSION 80
#define SLNK_MINOR_VERSION 81
#define SLNK_BUILD_VERSION 0
// Define resource strings