自己用 API 绘呀。 例: Declare Function SelectObject Lib "gdi32.dll" (ByVal hdc As Long, ByVal hObject As Long) As Long Declare Function CreateSolidBrush Lib "gdi32.dll" (ByVal crColor As Long) As Long Declare Function Rectangle Lib "gdi32.dll" (ByVal hdc As Long, ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long Declare Function DeleteObject Lib "gdi32.dll" (ByVal hObject As Long) As Long Dim hbrush As Long ' receives handle to the solid yellow brush Dim holdbrush As Long ' receives handle to Form1's default brush Dim retval As Long ' return valuehbrush = CreateSolidBrush(RGB(255, 255, 0)) ' create a solid yellow brush ' Save Form1's default brush so we can restore it after the program is finished holdbrush = SelectObject(Form1.hDC, hbrush) ' select the brush ' Draw the rectangle filled using the solid yellow brush retval = Rectangle(Form1.hDC, 10, 20, 175, 100) ' Restore Form1's previous brush before destroying the created one retval = SelectObject(Form1.hDC, holdbrush) ' select old brush retval = DeleteObject(hbrush) ' destroy the solid yellow brush
例:
Declare Function SelectObject Lib "gdi32.dll" (ByVal hdc As Long, ByVal hObject As Long) As Long
Declare Function CreateSolidBrush Lib "gdi32.dll" (ByVal crColor As Long) As Long
Declare Function Rectangle Lib "gdi32.dll" (ByVal hdc As Long, ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
Declare Function DeleteObject Lib "gdi32.dll" (ByVal hObject As Long) As Long Dim hbrush As Long ' receives handle to the solid yellow brush
Dim holdbrush As Long ' receives handle to Form1's default brush
Dim retval As Long ' return valuehbrush = CreateSolidBrush(RGB(255, 255, 0)) ' create a solid yellow brush
' Save Form1's default brush so we can restore it after the program is finished
holdbrush = SelectObject(Form1.hDC, hbrush) ' select the brush
' Draw the rectangle filled using the solid yellow brush
retval = Rectangle(Form1.hDC, 10, 20, 175, 100)
' Restore Form1's previous brush before destroying the created one
retval = SelectObject(Form1.hDC, holdbrush) ' select old brush
retval = DeleteObject(hbrush) ' destroy the solid yellow brush
图形方法
在如 Form、PictureBox 或 Printer 之类的对象上进行操作的方法,它执行运行时的绘图操作,如动画或模拟。图形方法有 Circle、Cls、Line、PaintPicture、Point、Print 和 Pset。
这个不错