7,763
社区成员
发帖
与我相关
我的任务
分享
'先到这里下载一个标准模块mGDIp.bas:http://www.cmd58.com/ku_web/UploadFile/201042114530261.rar
'用刷子填充一个矩形
Option Explicit
Dim graphics As Long
Dim pen As Long, brush As Long
Private Sub Form_Load()
InitGDIPlus
GdipCreateFromHDC Me.hDC, graphics
GdipCreatePen1 &HFFFF0000, 1, UnitPixel, pen
GdipCreateSolidFill &HAA0000FF, brush
GdipFillRectangleI graphics, brush, 30, 30, 100, 100
GdipDrawRectangleI graphics, pen, 30, 30, 100, 100
End Sub
Private Sub Form_Unload(Cancel As Integer)
GdipDeletePen pen
GdipDeleteBrush brush
GdipDeleteGraphics graphics '释放graphics占用的内存
TerminateGDIPlus
End Sub