Home Image-Pro Automation (Macros, Apps, Reports)

image class

Hi Guys how can I get the number of open images and their class (rgb, gray8 ect)? thank you Maurizio

Answers

  • edited November 2013
    Hi Maurizio,

    All visible Images are in ThisApplication.Images collection, the type of image is defined in McImage.Type (McImageType class). Here is a test macro that prints types of all opened images: 
    Imports MediaCy.IQL.Engine 
    ... 
      Public Sub ImagesReport()
            ThisApplication.Output.Show
            Dim n As Integer=ThisApplication.Images.Count
            ThisApplication.Output.PrintMessage("Number of opened images = " & n.ToString)
            For Each im As McImage In ThisApplication.Images
                Dim s As String=im.DisplayName
                Dim imType As McImageType=im.Type
                With imType
                    s+=", Quick Type = " & im.QuickType.ToString()
                    s+=", Number of Channels = " & .NumberOfChannels.ToString()
                    s+=", Bits per channel = " & .BitsPerChannel.ToString()
                End With
                ThisApplication.Output.PrintMessage(s)
            Next
        End Sub
    

    Regards,
    Yuri
Sign In or Register to comment.