知道GDI+编程的请进
Option Explicit
Dim graphics As Long
Dim pen As Long
Private Sub Form_Load()
'initgdiplus
GdipCreateFromHDC Form1.hDC, graphics
Form1.Circle (100, 100), 30, vbRed
GdipCreatePen1 &HFFFFFFFF, 1, UnitPixel, pen
GdipDrawLineI graphics, pen, 10, 10, 200, 100
Form1.Refresh
End Sub
Private Sub Form_Unload(Cancel As Integer)
GdipDeletePen pen '删除这个笔(pen)
GdipDeleteGraphics graphics '释放graphics占用的内存
'TerminateGDIPlus
End Sub
为什么上面initgdiplus跟terminnategdiplus无法调用
graphics创建成功,返回值是0,pen的返回值也是0,可是为么就画不出线!!!
[解决办法]
好像不能在Private Sub Form_Load()里画,应该在Private Sub Form_Paint()里面画
[解决办法]
贴完整的代码,不要只发一半。