run-time error
Posted: 2009-03-17T05:04:27-07:00
Hello, here is my piece of code:
but this result in a: runtime error '-2147418113 (8000ffff)'
with this (italian) description: Metodo 'Convert' dell'oggetto 'IMagickImage' non riuscito
witch is somethin' like: 'Convert' method of object 'IMagickImage' failed (sorry for the poor traslation )
Any hint of what could happen?
PS: I'm using STATIC ImageMagic version on a Visual Basic 6 (vb6) enviroment (on win XP home machine).
PPS: This command line works great: convert -resize "800x600" c:\desktop.bmp c:\destination.jpg
Code: Select all
Public Function ResizeImage(Style As Integer) As Boolean
Dim OriginalX As Integer
Dim OriginalY As Integer
Dim IMG As New ImageMagickObject.MagickImage 'carica e crea l'oggetto Image Magic
Dim BMP, JPN, Result As String 'NOTA: i file BMP devono essere in una variabile BMP e quelli JPG in una JPN
Dim DestinationRes As String
BMP = "c:\desktop.bmp" 'existing image from a screen-capture routine
JPN = "c:\resize.jpg"
OriginalX = Screen.Width \ Screen.TwipsPerPixelX 'detect resolution of the screen-captured image
OriginalY = Screen.Height \ Screen.TwipsPerPixelY
Select Case Style 'detect the type of resize the user wishes
Case 0 '640X480
DestinationRes = "640X480"
Case 1 '800x600
DestinationRes = "800x600"
Case 2 '1024x768
DestinationRes = "1024x768"
Case 3 '1280x1024
DestinationRes = "1280x1024"
Case 4
DestinationRes = OriginalX & "x" & OriginalY
End Select
Result = IMG.Convert("-resize", DestinationRes, BMP, JPN)
MsgBox Result
ResizeImage = True
Set IMG = Nothing
End Function
with this (italian) description: Metodo 'Convert' dell'oggetto 'IMagickImage' non riuscito
witch is somethin' like: 'Convert' method of object 'IMagickImage' failed (sorry for the poor traslation )
Any hint of what could happen?
PS: I'm using STATIC ImageMagic version on a Visual Basic 6 (vb6) enviroment (on win XP home machine).
PPS: This command line works great: convert -resize "800x600" c:\desktop.bmp c:\destination.jpg