- Код: Выделить всё
pbDochDC = CreateCompatibleDC(GetDC(0))
pbDocHeight = 500
pbDocWidth = 500
hBmp = CreateCompatibleBitmap(GetDC(0), pbDocWidth, pbDocHeight)
hBmpPrev = SelectObject(pbDochDC, hBmp)
Dim hOldPen As Long, hOldBrush As Long '
hPen = CreatePen(0, 0, RGB(100, 100, 100))
hOldPen = SelectObject(pbDochDC, hPen)
hBrush = CreateSolidBrush(RGB(100, 100, 100))
hOldBrush = SelectObject(pbDochDC, hBrush)
retval = Rectangle(pbDochDC, 0, 0, pbDocWidth, pbDocHeight)
retval = SelectObject(pbDochDC, hOldPen)
retval = SelectObject(pbDochDC, hOldBrush)
retval = DeleteObject(hPen)
retval = DeleteObject(hBrush)
NewFont = CreateFont(p_HEIGHT, p_WIDTH, 0, 0, FF_DONTCARE, 0, 0, 0, ANSI_CHARSET, OUT_TT_ONLY_PRECIS, CLIP_LH_ANGLES Or CLIP_DEFAULT_PRECIS, PROOF_QUALITY, TRUETYPE_FONTTYPE, "Courier New")
OldFont = SelectObject(pbDochDC, NewFont)
TextOut pbDochDC, x, y, a$, Len(a$)
NewFont = SelectObject(pbDochDC, OldFont)
DeleteObject NewFont
hBmp = SelectObject(pbDochDC, hBmpPrev)
ret = DeleteDC(pbDochDC)