Private Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long Private Const SRCCOPY = &HCC0020 ' (DWORD) dest = source Private Sub Command1_Click() RichTextBox1.SelColor = RGB(255, 0, 0) RichTextBox1.SelAlignment = 2 End SubPrivate Sub Command2_Click() Dim a As Long a = BitBlt(Picture1.hDC, 0, 0, 300, 300, GetDC(RichTextBox1.hwnd), 0, 0, SRCCOPY) End Sub
Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
Private Const SRCCOPY = &HCC0020 ' (DWORD) dest = source
Private Sub Command1_Click()
RichTextBox1.SelColor = RGB(255, 0, 0)
RichTextBox1.SelAlignment = 2
End SubPrivate Sub Command2_Click()
Dim a As Long
a = BitBlt(Picture1.hDC, 0, 0, 300, 300, GetDC(RichTextBox1.hwnd), 0, 0, SRCCOPY)
End Sub
RichTextBox1.SelPrint Picture1.hDC
字的大小,颜色OK,
对齐方式...是否需要计算开始位置了;(