|
发表于 2020-10-13 20:30:01
|
显示全部楼层
gdi+就很好呀,vb6中这样用
Public Declare Function GdiplusStartup Lib "gdiplus.dll" _
(token As Long, inputbuf As GdiplusStartupInput, Optional ByVal outputbuf As Long = 0) As GpStatus
Public Declare Sub GdiplusShutdown Lib "gdiplus.dll" _
(ByVal token As Long)
'----------------GDI+-------------------
Public GpInput As GdiplusStartupInput
Public token As Long ' Needed to close GDI+
' NOTE: Enums evaluate to a Long
Public Enum GpStatus ' aka Status
Ok = 0
GenericError = 1
InvalidParameter = 2
OutOfMemory = 3
ObjectBusy = 4
InsufficientBuffer = 5
NotImplemented = 6
Win32Error = 7
WrongState = 8
Aborted = 9
FileNotFound = 10
ValueOverflow = 11
AccessDenied = 12
UnknownImageFormat = 13
FontFamilyNotFound = 14
FontStyleNotFound = 15
NotTrueTypeFont = 16
UnsupportedGdiplusVersion = 17
GdiplusNotInitialized = 18
PropertyNotFound = 19
PropertyNotSupported = 20
End Enum
Private Sub Form_Load()
'gdi+初始化
GpInput.GdiplusVersion = 1
If GdiplusStartup(token, GpInput) <> Ok Then
MsgBox "初始化GDI+错误!" & Chr(13) & "gdiplus.dll出现故障!", vbCritical, "程序启动失败"
Unload Me
Exit Sub
End If
End Sub
Private Sub Form_Unload(Cancel As Integer)
Call GdipClose
End Sub
Public Sub GdipClose()
Call GdiplusShutdown(token)
End Sub
gdiplus.dll可以从QQ的文件夹中找到,网上有专门的gdi+处理图形图片的vb模块文件。 |
|