|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
Public Function PNGtoBMP(ByVal SourceFilename As String, ByVal DestinationFilename As String) As Boolean
Dim GSI As GdiplusStartupInput
Dim lGDIP As Long
Dim lBitmap As Long
Dim bmpEncoder As GUID
GSI.GdiplusVersion = 1
If GdiplusStartup(lGDIP, GSI, 0) = STATUS_OK Then
If GdipCreateBitmapFromFile(StrPtr(SourceFilename), lBitmap) = STATUS_OK Then
If CLSIDFromString(StrPtr("{557CF400-1A04-11D3-9A73-0000F81EF32E}"), bmpEncoder) = NOERROR Then
If GdipSaveImageToFile(lBitmap, StrPtr(DestinationFilename), bmpEncoder, ByVal 0) = STATUS_OK Then
PNGtoBMP = True
End If
End If
Call GdipDisposeImage(lBitmap)
End If
Call GdiplusShutdown(lGDIP)
End If
End Function
|
|