Help on x.Identify / Visual Basic Express 2008

ImageMagickObject is a Windows COM+ interface to ImageMagick. COM+, Visual Basic, and Delphi users should post to this discussion group.
Post Reply
MoBO

Help on x.Identify / Visual Basic Express 2008

Post by MoBO »

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 ;

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
This code is working just fine :D

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
And.... this work just fine :D

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

Code: Select all

MSGS = img.Convert("-identify", "-verbose", BMP)
And get absolutely nothing returned on the MSGS variable... :( :( :(

Any help ?
MoBO

Re: Help on x.Identify / Visual Basic Express 2008

Post by MoBO »

Hello,

after looking for adding some reflection on my picture, I found an interesting note and... found something.

Code: Select all

MSGS = img.Identify("-format", "%h", BMP)
This entry provided the height size !

So ;
  • %h = Height
    %w = Width
Still have some work to be done.

But if any could provide more detail and/or information.... will be welcome !
Use of the ImageMagickObject seems to be not so documented (If you know a link or document, PLEASE provide it to me).
Post Reply