如题!
解决方案 »
- 百分求VSVIEW和水晶报表的属性表...
- 急!!!!如何将ACCESS数据逐条导入EXEL表格中啊?谢谢了
- Dim Cn As ADODB.Connection错误!!!!!!!!
- 更新大量数据时,程序很慢,像死了一样。。。怎么办?
- 用INSERT INTO之后用什么方法刷新可以立即获得新的数据集
- vb数组
- 用VB发送邮件(不用MAPI)?谢谢!
- NT4.0为什么不认我的日期格式?急急急!!!
- 关于注册表函数RegEnumKeyEx如何使用,谁能举个例,示范一下?
- 大家帮个忙吧,一个把text控件内的值添加到access数据库的小问题.
- vb6.0关于自动调整图形大小问题
- 求“所见即所得”的网页编辑器
1. 用第3方控件,下载
2. 用编辑软件将png格式图片另存为jpg
速度快,使用也简单。
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 Type GdiplusStartupInput
GdiplusVersion As Long
DebugEventCallback As Long
SuppressBackgroundThread As Long
SuppressExternalCodecs As Long
End TypePrivate Declare Function GdiplusStartup Lib "gdiplus" (token As Long, inputbuf As GdiplusStartupInput, Optional ByVal outputbuf As Long = 0) As GpStatus
Private Declare Sub GdiplusShutdown Lib "gdiplus" (ByVal token As Long)Private Declare Function GdipCreateFromHDC Lib "gdiplus" (ByVal hdc As Long, graphics As Long) As GpStatus
Private Declare Function GdipLoadImageFromFile Lib "gdiplus" (ByVal filename As String, image As Long) As GpStatusPrivate Declare Function GdipDeleteGraphics Lib "gdiplus" (ByVal graphics As Long) As GpStatus
Private Declare Function GdipDisposeImage Lib "gdiplus" (ByVal image As Long) As GpStatus
Private Declare Function GdipCreateBitmapFromFile Lib "gdiplus" (ByVal filename As Long, bitmap As Long) As GpStatusPrivate Declare Function GdipCreateCachedBitmap Lib "gdiplus" (ByVal bitmap As Long, ByVal graphics As Long, cachedBitmap As Long) As GpStatus
Private Declare Function GdipDrawCachedBitmap Lib "gdiplus" (ByVal graphics As Long, ByVal cachedBitmap As Long, ByVal x As Long, ByVal y As Long) As GpStatus
Private Declare Function GdipDeleteCachedBitmap Lib "gdiplus" (ByVal cachedBitmap As Long) As GpStatusDim token As LongPrivate Sub Form_Load()
Dim GpInput As GdiplusStartupInput
Dim graphics As Long, lhdc As Long
Dim lngImage As Long, stat As GpStatus
Dim lngCached As Long, filename As String
Dim i As Integer, startTime As Single
Dim finalTime As Single 'Set your fileName in here.
filename = App.Path & "\a.png"
' MsgBox filename
GpInput.GdiplusVersion = 1
If GdiplusStartup(token, GpInput) <> Ok Then
MsgBox "Error loading GDI+", vbCritical
Unload Me
End If
Me.AutoRedraw = True
Picture1.AutoRedraw = True
Picture1.Left = -Picture1.Width
'Initialize the graphics class
If GdipCreateFromHDC(Picture1.hdc, graphics) = Ok Then
startTime = 1
If GdipLoadImageFromFile(StrConv(filename, vbUnicode), lngImage) = Ok Then
For i = 0 To 1 ' 1000
stat = GdipCreateCachedBitmap(lngImage, graphics, lngCached)
stat = GdipDrawCachedBitmap(graphics, lngCached, Me.ScaleLeft, Me.ScaleTop)
stat = GdipDeleteCachedBitmap(lngCached) Next
End If
finalTime = i - 1
Me.Caption = finalTime GdipDisposeImage lngImage
GdipDeleteGraphics graphics
Else
Unload Me
End If
Set Image1.Picture = Picture1.image
End SubPrivate Sub Form_Unload(Cancel As Integer)
GdiplusShutdown (token)
End Sub