318 RECT rc = {
cx - radius,
cy - radius,
cx + radius,
cy + radius };
332 RECT rc = {
cx - radius,
cy - radius,
cx + radius,
cy + radius };
353 RECT rc = {
cx - radius,
cy - radius,
cx + radius,
cy + radius };
404 for (
a = 0;
a <=
b;
a++)
407 (
x1 * (
b -
a) +
x2 *
a) /
b - (thickness / 2),
408 (
y1 * (
b -
a) +
y2 *
a) /
b - (thickness / 2),
409 (
x1 * (
b -
a) +
x2 *
a) /
b + (thickness / 2) + 1,
410 (
y1 * (
b -
a) +
y2 *
a) /
b + (thickness / 2) + 1);
415 for (
a = 0;
a <=
b;
a++)
418 (
x1 * (
b -
a) +
x2 *
a) /
b - (thickness / 2),
419 (
y1 * (
b -
a) +
y2 *
a) /
b - (thickness / 2),
420 (
x1 * (
b -
a) +
x2 *
a) /
b + (thickness / 2) + 1,
421 (
y1 * (
b -
a) +
y2 *
a) /
b + (thickness / 2) + 1);
428 POINT offsetTop, offsetBottom;
431 offsetTop = { (thickness - 1) / 2 + 1, -(thickness - 1) / 2 };
432 offsetBottom = { -thickness / 2 , thickness / 2 + 1 };
436 offsetTop = { -thickness / 2 , -thickness / 2 };
437 offsetBottom = { (thickness - 1) / 2 + 1, (thickness - 1) / 2 + 1 };
445 {
x1 + offsetTop.
x,
y1 + offsetTop.
y },
446 {
x1 + offsetBottom.
x,
y1 + offsetBottom.
y },
447 {
x2 + offsetBottom.
x,
y2 + offsetBottom.
y },
448 {
x2 + offsetTop.
x,
y2 + offsetTop.
y },
565 HDC hdcSrc,
int nXSrc,
int nYSrc,
int nSrcWidth,
int nSrcHeight,
568 HDC hTempDC1, hTempDC2;
569 HBITMAP hbmTempColor, hbmTempMask;
582 hdcSrc, nXSrc, nYSrc, nSrcWidth, nSrcHeight, keyColor);
586 else if (nWidth == nSrcWidth && nHeight == nSrcHeight && keyColor ==
CLR_INVALID)
588 ::MaskBlt(hdcDest, nXDest, nYDest, nWidth, nHeight,
601 ::StretchBlt(hTempDC2, 0, 0, nWidth, nHeight, hTempDC1, 0, 0, nSrcWidth, nSrcHeight,
SRCCOPY);
613 ::MaskBlt(hdcDest, nXDest, nYDest, nWidth, nHeight, hTempDC1, 0, 0,
619 ::BitBlt(hTempDC1, 0, 0, nWidth, nHeight, hdcDest, nXDest, nYDest,
SRCCOPY);
623 hdcSrc, nXSrc, nYSrc, nSrcWidth, nSrcHeight, keyColor);
626 ::MaskBlt(hdcDest, nXDest, nYDest, nWidth, nHeight, hTempDC1, 0, 0,
653 static const BYTE s_bayerMatrix[8][8] =
655 { 0, 32, 8, 40, 2, 34, 10, 42 },
656 { 48, 16, 56, 24, 50, 18, 58, 26 },
657 { 12, 44, 4, 36, 14, 46, 6, 38 },
658 { 60, 28, 52, 20, 62, 30, 54, 22 },
659 { 3, 35, 11, 43, 1, 33, 9, 41 },
660 { 51, 19, 59, 27, 49, 17, 57, 25 },
661 { 15, 47, 7, 39, 13, 45, 5, 37 },
662 { 63, 31, 55, 23, 61, 29, 53, 21 },
668 if (brightness >= 255)
682 for (
INT y = 0;
y < 8; ++
y)
685 for (
INT x = 0;
x < 8; ++
x)
687 const INT threshold = s_bayerMatrix[
y][
x] * 255 / 63;
688 if (brightness > threshold)
DWORD GetPixel(LPDIRECTDRAWSURFACE7 Surface, UINT x, UINT y)
HBITMAP CreateColorDIB(int width, int height, COLORREF rgb)
_ACRTIMP __msvcrt_long __cdecl labs(__msvcrt_long)
_ACRTIMP int __cdecl rand(void)
void RectSel(HDC hdc, LONG x1, LONG y1, LONG x2, LONG y2)
void Bezier(HDC hdc, POINT p1, POINT p2, POINT p3, POINT p4, COLORREF color, int thickness)
HBRUSH CreateDitherBrush(COLORREF color, COLORREF monoColor0, COLORREF monoColor1)
void Ellp(HDC hdc, LONG x1, LONG y1, LONG x2, LONG y2, COLORREF fg, COLORREF bg, int thickness, int style)
void Poly(HDC hdc, POINT *lpPoints, int nCount, COLORREF fg, COLORREF bg, int thickness, int style, BOOL closed, BOOL inverted)
BOOL ColorKeyedMaskBlt(HDC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HDC hdcSrc, int nXSrc, int nYSrc, int nSrcWidth, int nSrcHeight, HBITMAP hbmMask, COLORREF keyColor)
void DrawXorRect(HDC hdc, const RECT *prc)
void RRect(HDC hdc, LONG x1, LONG y1, LONG x2, LONG y2, COLORREF fg, COLORREF bg, int thickness, int style)
void Replace(HDC hdc, LONG x1, LONG y1, LONG x2, LONG y2, COLORREF fg, COLORREF bg, LONG radius)
void Erase(HDC hdc, LONG x1, LONG y1, LONG x2, LONG y2, COLORREF color, LONG radius)
static void BrushInternal(HDC hdc, LONG x1, LONG y1, LONG x2, LONG y2, LONG style, INT thickness)
void Airbrush(HDC hdc, LONG x, LONG y, COLORREF color, LONG r)
static HPEN CreateGeometricPen(COLORREF rgbColor, INT thickness)
void Fill(HDC hdc, LONG x, LONG y, COLORREF color)
static VOID BitBlt(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Width, _In_ ULONG Height, _In_reads_bytes_(Height *Stride) PUCHAR Buffer, _In_ ULONG BitsPerPixel, _In_ ULONG Stride)
GLint GLint GLint GLint GLint x
GLint GLint GLsizei GLsizei GLsizei GLint GLenum GLenum const GLvoid * pixels
GLint GLint GLint GLint GLint GLint y
GLdouble GLdouble GLdouble r
GLboolean GLboolean GLboolean b
GLboolean GLboolean GLboolean GLboolean a
GLsizei const GLfloat * points
static CRYPT_DATA_BLOB b1[]
INT WINAPI DrawTextW(HDC hdc, LPCWSTR str, INT count, LPRECT rect, UINT flags)
BOOL Polygon(CONST PPOINT UnsafePoints, int Count, int polyFillMode)
_Out_opt_ int _Out_opt_ int * cy
static int sum(int x_, int y_)
BITMAPINFOHEADER bmiHeader
BOOL WINAPI GdiTransparentBlt(HDC hdcDst, int xDst, int yDst, int wDst, int hDst, HDC hdcSrc, int xSrc, int ySrc, int wSrc, int hSrc, UINT crTransparent)
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG x1
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG y1
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG _In_ LONG _In_ LONG y2
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG _In_ LONG x2
HBRUSH WINAPI CreateBrushIndirect(_In_ const LOGBRUSH *plb)
BOOL WINAPI PolyBezier(_In_ HDC hdc, _In_reads_(cpt) const POINT *apt, _In_ DWORD cpt)
HGDIOBJ WINAPI GetStockObject(_In_ int)
BOOL WINAPI Polyline(_In_ HDC hdc, _In_reads_(cpt) const POINT *apt, _In_ int cpt)
HBITMAP WINAPI CreateBitmap(_In_ INT cx, _In_ INT cy, _In_ UINT cPlanes, _In_ UINT cBitsPerPel, _In_opt_ const VOID *pvBits)
BOOL WINAPI Ellipse(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int)
COLORREF WINAPI SetBkColor(_In_ HDC, _In_ COLORREF)
HPEN WINAPI ExtCreatePen(_In_ DWORD iPenStyle, _In_ DWORD cWidth, _In_ const LOGBRUSH *plbrush, _In_ DWORD cStyle, _In_reads_opt_(cStyle) const DWORD *pstyle)
int WINAPI IntersectClipRect(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
BOOL WINAPI MoveToEx(_In_ HDC, _In_ int, _In_ int, _Out_opt_ LPPOINT)
BOOL WINAPI MaskBlt(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _In_ HDC, _In_ int, _In_ int, _In_ HBITMAP, _In_ int, _In_ int, _In_ DWORD)
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
BOOL WINAPI StretchBlt(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _In_opt_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _In_ DWORD)
BOOL WINAPI RestoreDC(_In_ HDC, _In_ int)
int WINAPI GetROP2(_In_ HDC)
HRGN WINAPI PathToRegion(_In_ HDC)
BOOL WINAPI SetPixelV(_In_ HDC, _In_ int, _In_ int, _In_ COLORREF)
int WINAPI FillRgn(_In_ HDC, _In_ HRGN, _In_ HBRUSH)
BOOL WINAPI WidenPath(_In_ HDC)
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
BOOL WINAPI Rectangle(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int)
int WINAPI SetBkMode(_In_ HDC, _In_ int)
COLORREF WINAPI SetTextColor(_In_ HDC, _In_ COLORREF)
int WINAPI SetROP2(_In_ HDC, _In_ int)
BOOL WINAPI RoundRect(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _In_ int, _In_ int)
HBRUSH WINAPI CreateSolidBrush(_In_ COLORREF)
BOOL WINAPI DeleteDC(_In_ HDC)
HPEN WINAPI CreatePen(_In_ int, _In_ int, _In_ COLORREF)
HBITMAP WINAPI CreateDIBitmap(_In_ HDC hdc, _In_opt_ const BITMAPINFOHEADER *pbmih, _In_ DWORD fdwInit, _In_opt_ const VOID *pvInit, _In_opt_ const BITMAPINFO *pbmi, _In_ UINT uUsage)
BOOL WINAPI EndPath(_In_ HDC)
BOOL WINAPI ExtFloodFill(_In_ HDC, _In_ int, _In_ int, _In_ COLORREF, _In_ UINT)
BOOL WINAPI LineTo(_In_ HDC, _In_ int, _In_ int)
BOOL WINAPI BeginPath(_In_ HDC hdc)
int WINAPI SaveDC(_In_ HDC)
HBRUSH WINAPI CreatePatternBrush(_In_ HBITMAP)
int WINAPI SetPolyFillMode(_In_ HDC, _In_ int)
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
DWORD WINAPI GetSysColor(_In_ int)
HDC WINAPI GetDC(_In_opt_ HWND)