ImageMagick
Publicado por alberto alvarez dominguez (1 intervención) el 19/05/2005 21:12:23
Quiero usar el objeto ImageMagick en mi aplicación para modificar imagenes, he conseguido usando la funcion shell con parametros y me funciona, pero he visto que con el objeto se pueden hacer maravillas y me gustaria usarlo he localizado un codigo que le llamo desde la linea de comandos pero no me funciona cuando lo modifico. Realmente lo que quiero hacer es girar una imagen, cambiar tamaño y nombre, añadirle marca de agua y creo que es la mejor opcion pero estoy un poco atascado. Tengo el siguiente codigo que funciona pero no soy capaz de modifcarlo para mis necesidades no quiero que el archivo se le de por la linea de comandos como va ahi y ademas me gustaria saber que funciones tiene esa funcion para poder usarla tambien seria interesante poder user la funcion identify para que me de todos los datos de las fotos, te dice hasta de que camara la saca, pero yo no soy capaz de ponerlo a andar si me echaseis una mano os lo agradeceria, el codigo que tengo es el siguiente:
Private Sub Main()
Dim imo As Variant, s As String
If Len(Command$) = 0 Then
MsgBox "Usage: thumb <absolute or relative path to image>"
Exit Sub
End If
On Error Resume Next
' Create the object using registered name of class.
'
Set imo = CreateObject("ImageMagickObject.MagickImage.1")
If Err Then
MsgBox "CreateObject Error: " & Err.Number & vbCrLf & _
Err.Description
Exit Sub
End If
' Call the object directly. Note.. there is nothing to initialize
' ..the following.. (see above)
s = imo.Convert( _
"-resize=300x300", _
"+profile=""*""", _
Command$, _
Left(Command$, InStrRev(Command$, ".") - 1) & "-t.jpg")
If Err Then
MsgBox "CreateObject Error: " & Err.Number & vbCrLf & _
Err.Description
Exit Sub
End If
MsgBox "Successfull... " & vbCrLf & " String returned: " & s
MsgBox i
End Sub
No se si me pudiese ayudar os lo agradeciria estoy muy atacasdo.
Private Sub Main()
Dim imo As Variant, s As String
If Len(Command$) = 0 Then
MsgBox "Usage: thumb <absolute or relative path to image>"
Exit Sub
End If
On Error Resume Next
' Create the object using registered name of class.
'
Set imo = CreateObject("ImageMagickObject.MagickImage.1")
If Err Then
MsgBox "CreateObject Error: " & Err.Number & vbCrLf & _
Err.Description
Exit Sub
End If
' Call the object directly. Note.. there is nothing to initialize
' ..the following.. (see above)
s = imo.Convert( _
"-resize=300x300", _
"+profile=""*""", _
Command$, _
Left(Command$, InStrRev(Command$, ".") - 1) & "-t.jpg")
If Err Then
MsgBox "CreateObject Error: " & Err.Number & vbCrLf & _
Err.Description
Exit Sub
End If
MsgBox "Successfull... " & vbCrLf & " String returned: " & s
MsgBox i
End Sub
No se si me pudiese ayudar os lo agradeciria estoy muy atacasdo.
Valora esta pregunta


0