Help on x.Identify / Visual Basic Express 2008
Posted: 2009-03-10T08:09:25-07:00
Hello,
I'm trying to work with Imagemagick within a visual basic express 2008 application and I'm facing many troubles because of lack of information.
I did some search on the net and wasn't able to find some relevant and helpful information yet.
I created the following code to do some test ;
This code is working just fine
Then I tried to modify some perspective
Based on the same code...
And.... this work just fine
Now, my problem....
I want to get more information on the image first (size) before applying a resize and perspective but I'm not able to use the Identify
I tried ;
or
And get absolutely nothing returned on the MSGS variable...
Any help ?
I'm trying to work with Imagemagick within a visual basic express 2008 application and I'm facing many troubles because of lack of information.
I did some search on the net and wasn't able to find some relevant and helpful information yet.
I created the following code to do some test ;
Code: Select all
Private Sub cmdIMagic_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdIMagic.Click
'
'Information
'
' A directory called C:\BMP is existing and contain 6 images with BMP extension took from C:\Windows
' A subdirectory called JPG (C:\BMP\JPG) is existing and contain nothing (yet)
' All 6 BMP image from C:\BMP will be converted to JPG and resized to x128 within the directory C:\BMP\JPG
'
'
'
Dim img As ImageMagickObject.MagickImage
Dim I As VariantType
Dim BMP, JPN, MSGS As String
img = New ImageMagickObject.MagickImage
For I = 1 To 6
BMP = "C:\bmp\a" & Str(I) & ".bmp" ' bmp name
JPN = "C:\bmp\JPG\a" & Str(I) & ".jpg" ' jpn name
MSGS = img.Convert("-resize", "x128", BMP, JPN)
Next
img = Nothing
End Sub
Then I tried to modify some perspective
Based on the same code...
Code: Select all
Private Sub cmdIMagic_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdIMagic.Click
'
'Information
'
' A directory called C:\BMP is existing and contain 6 images with BMP extension took from C:\Windows
' A subdirectory called JPG (C:\BMP\JPG) is existing and contain nothing (yet)
' All 6 BMP image from C:\BMP will get perspective to JPG within the directory C:\BMP\JPG
'
'
Dim img As ImageMagickObject.MagickImage
Dim I As VariantType
Dim BMP, JPN, MSGS As String
img = New ImageMagickObject.MagickImage
For I = 1 To 6
BMP = "C:\bmp\a" & Str(I) & ".bmp" ' bmp name
JPN = "C:\bmp\JPG\a" & Str(I) & ".jpg" ' jpn name
MSGS = img.Convert("-matte", "-virtual-pixel", "transparent", "-distort", "Perspective", "0,0,0,0 0,90,0,90 90,0,90,25 90,90,90,65", BMP, JPN)
Next
img = Nothing
End Sub
Now, my problem....
I want to get more information on the image first (size) before applying a resize and perspective but I'm not able to use the Identify
I tried ;
Code: Select all
MSGS = img.Identify("-verbose", BMP)
Code: Select all
MSGS = img.Convert("-identify", "-verbose", BMP)
Any help ?