|
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
|
|