Click or drag to resize

ImagesOperatorsTotalImageCount Method

The total number of McImage instances, whether part of the Image collection or not.

Namespace:  MediaCy.IQL.Operators
Assembly:  MediaCy.IQL.Operators (in MediaCy.IQL.Operators.dll) Version: 3.1.0.0
Syntax
VB
<ExtensionAttribute>
Public Shared Function TotalImageCount ( 
	images As McImages
) As Integer

Parameters

images
Type: MediaCy.IQL.EngineMcImages

Return Value

Type: Int32

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type McImages. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Remarks
The McEngine.Images.Count property only gives the number of images in the collection. But images that are created with themcImageCreateFlags.mcicfNoAddToCollection bit, or images that are closed (see McImage.Close) or otherwise removed from the collection, will still exist as long as a reference is held on them. The McImages.TotalImageCount property gives an easy way to get the count of all images being managed by a particular McEngine instance. McImage instances are operators that have a backing McObject which is part of the mcobjRegCategories.McCatImage category; all images are also children of the McEngine.Images McImages instance, even if they are not part of its collection. If you want to enumerate the images that are outside the Images collection, you need to use object manager methods do so, as illustrated in the example. After accessing this property, the McEngine.McObjects enumeration filters (see McObjects.SetEnumFilters) will have been reset to no filter.
Examples
VB
'Here is a way to do it using the McObjects collection
Sub CountImages()
ThisApplication.Output.Show ("Output")
Dim lCollectionCount As Long, lAllImagesCount As Long
lCollectionCount = ThisApplication.Images.Count
ThisApplication.Output.PrintMessage "---> Images in Images collection: " & Str(lCollectionCount)
Dim nI As Long
For nI = 0 To lCollectionCount - 1
ThisApplication.Output.PrintMessage Str(nI) & " Image Name: " & ThisApplication.Images(nI).Name
Next nI
ThisApplication.McObjects.SetEnumFilters McCatImage, , , , ThisApplication.McObject(Images)
lAllImagesCount = ThisApplication.McObjects.Count
ThisApplication.Output.PrintMessage "--> All images: " & Str(lAllImagesCount)
Dim mcobjImage As McObject, nO As Long
For Each mcobjImage In ThisApplication.McObjects
ThisApplication.Output.PrintMessage Str(nO) & " McObject Name: " & mcobjImage.Name
nO = nO + 1
Next mcobjImage
End Sub 'CountImages
See Also