5 bi.bmi.biSize =
sizeof(bi.bmi);
6 bi.bmi.biWidth = size.cx;
7 bi.bmi.biHeight = size.cy;
9 bi.bmi.biBitCount = 24;
10 bi.bmi.biCompression = BI_RGB;
12 return CreateDIBSection(NULL, reinterpret_cast<const BITMAPINFO*>(&bi), DIB_RGB_COLORS,&bitsPtr,0,0);
19 bi.bmi.biSize =
sizeof(bi.bmi);
20 bi.bmi.biWidth = size.cx;
21 bi.bmi.biHeight = size.cy;
23 bi.bmi.biBitCount = 16;
24 bi.bmi.biCompression = BI_RGB;
26 return CreateDIBSection(NULL, reinterpret_cast<const BITMAPINFO*>(&bi), DIB_RGB_COLORS,&bitsPtr,0,0);
29 static HBITMAP
CreateDIB8(CSize size,
const COLORREF palette[256]) {
34 for(
int c = 0; c < 256; ++c ) bi.colors[c] = palette[c];
35 bi.bmi.biSize =
sizeof(bi.bmi);
36 bi.bmi.biWidth = size.cx;
37 bi.bmi.biHeight = size.cy;
39 bi.bmi.biBitCount = 8;
40 bi.bmi.biCompression = BI_RGB;
41 bi.bmi.biClrUsed = 256;
43 return CreateDIBSection(NULL, reinterpret_cast<const BITMAPINFO*>(&bi), DIB_RGB_COLORS,&bitsPtr,0,0);
48 WIN32_OP_D( in.GetLogFont(lf) );
52 WIN32_OP_D( out.CreateFontIndirect(&lf) != NULL );
57 WIN32_OP_D( in.GetLogFont(lf) );
62 WIN32_OP_D( out.CreateFontIndirect(&lf) != NULL );
73 template<
typename TCtrl>
90 SubclassWindow(wnd); SetFont(
m_font);
105 m_dc.GetClipRgn(m_rgn);
108 m_dc.SelectClipRgn(m_rgn);
111 HRGN
OldVal()
const throw() {
return m_rgn;}
121 SetDCBrushColor(dc, color);
return (HBRUSH) GetStockObject(DC_BRUSH);
128 m_oldCol = m_dc.SetDCBrushColor(color);
129 m_hBrush = (HBRUSH) GetStockObject(DC_BRUSH);
132 m_dc.SetDCBrushColor(m_oldCol);
144 m_oldCol = m_dc.SetDCPenColor(color);
145 m_hPen = (HPEN) GetStockObject(DC_PEN);
148 m_dc.SetDCPenColor(m_oldCol);
159 CreateCompatibleDC(NULL);
160 ATLASSERT(m_hDC != NULL);
167 m_bitmap.Attach(bmp); m_curSize = size;
168 m_bitmapOld = SelectBitmap(m_bitmap);
172 bool state = CBitmapHandle(bmp).GetSize(size);
177 if (m_hDC == NULL)
return FALSE;
178 if (m_curSize == size)
return TRUE;
181 if (dcCompatible == NULL) {
184 temp = CreateCompatibleBitmap(dcCompatible, size.cx, size.cy);
186 if (temp == NULL)
return FALSE;
192 if (m_bitmap != NULL) {
193 SelectBitmap(m_bitmapOld); m_bitmapOld = NULL;
194 m_bitmap.DeleteObject();
196 m_curSize = CSize(0,0);
199 if (m_bitmap == NULL)
return FALSE;
201 if (!m_bitmap.GetBitmap(bmp))
return FALSE;
202 lineWidth = bmp.bmWidthBytes;
203 ptr =
reinterpret_cast<t_uint8*
>(bmp.bmBits);
217 CBackBufferScope(HDC hDC, HDC hDCBB,
const CRect & rcPaint) : CDCHandle(hDCBB), m_dcOrig(hDC), m_rcPaint(rcPaint)
219 GetClipRgn(m_clipRgnOld);
221 if (m_dcOrig.GetClipRgn(temp) == 1) {
222 if (m_clipRgnOld != NULL) temp.CombineRgn(m_clipRgnOld,RGN_AND);
225 IntersectClipRect(rcPaint);
230 m_dcOrig.BitBlt(m_rcPaint.left,m_rcPaint.top,m_rcPaint.Width(),m_rcPaint.Height(),m_hDC,m_rcPaint.left,m_rcPaint.top,SRCCOPY);
231 SelectClipRgn(m_clipRgnOld);
int sgn_t(const T &p_val)
static void CreatePreferencesHeaderFont(CFont &out, CWindow source)
CDCPen(HDC dc, COLORREF color)
void SHARED_EXPORT scale(const audio_sample *p_source, t_size p_count, audio_sample *p_output, audio_sample p_scale)
p_source/p_output can point to same buffer
CFontScaled(HFONT _in, double scale)
static void CreatePreferencesHeaderFont2(CFont &out, CWindow source)
typedef BOOL(WINAPI *pPowerSetRequest_t)(__in HANDLE PowerRequest
void Initialize(CWindow wnd, double scale, int weight)
static HBITMAP CreateDIB16(CSize size)
void MakeHeader(CWindow wnd)
CDCBrush(HDC dc, COLORREF color)
static void CreateScaledFont(CFont &out, CFontHandle in, double scale)
t_int32 rint32(double p_val)
static HBRUSH MakeTempBrush(HDC dc, COLORREF color)
static void CreateScaledFontEx(CFont &out, CFontHandle in, double scale, int weight)
CBackBufferScope(HDC hDC, HDC hDCBB, const CRect &rcPaint)
pfc::sized_int_t< sizeof(size_t) >::t_signed t_ssize
void Attach(HBITMAP bmp, CSize size)
static HBITMAP CreateDIB8(CSize size, const COLORREF palette[256])
void _initWnd(CWindow wnd)
BOOL GetBitmapPtr(t_uint8 *&ptr, t_ssize &lineWidth)
static HBITMAP CreateDIB24(CSize size)
void MakeHeader2(CWindow wnd)
BOOL Allocate(CSize size, HDC dcCompatible=NULL)