Click or drag to resize

IMcImagesCount Property

Count of images in the Images collection

Namespace:  MediaCy.IQL.Engine
Assembly:  MediaCy.IQL.Engine (in MediaCy.IQL.Engine.dll) Version: 10.0.6912.0
Syntax
VB
ReadOnly Property Count As Integer
	Get

Property Value

Type: Int32
Remarks
There are usually more images being maintained by the system than those that are in the collection. Temporary images are created for a number of purposes with the mcicfNoAddToCollection mcImageCreateFlags bit set in the Flags argument to the Add method. Some of these temporary images may be persistent; for example, the image on the clipboard is not part of the collection and it is kept until something else is put on the clipboard or until the application closes. Or some macro may be holding a reference on such a temporary image. The example shows how to get a count of both images in the Images collection and all images, including those not in the collection.
Examples
VB
'Show a count and names of images in the Images collection and of all images
Sub CountImagesExample()
With ThisApplication.Engine
Dim strOutput As String
Dim lCollectionCount As Integer, lAllImagesCount As Integer
lCollectionCount = .Images.Count
strOutput = "---> Images in Images collection: " & CStr(lCollectionCount)
Dim nI As Integer
For nI = 0 To lCollectionCount - 1
strOutput = strOutput + vbCrLf + CStr(nI) & " Image Name: " & .Images(nI).Name + vbCrLf +  _
"     Display Name: " & .Images(nI).DisplayName
Next nI
'Enumerate all McObject instances in the McObjects collection in the McCatImage category with Engine.Images as parent
.McObjects.SetEnumFilters(mcobjRegCategories.McCatImage, , , , .McObject(.Images))
lAllImagesCount = .McObjects.Count
strOutput = strOutput + vbCrLf + "--> All images: " & CStr(lAllImagesCount)
Dim mcobjImage As MediaCy.IQL.ObjectManager.McObject, nO As Integer = 0
For Each mcobjImage In .McObjects
strOutput = strOutput + vbCrLf + CStr(nO) & " McObject Name: " & mcobjImage.Name
nO = nO + 1
Next mcobjImage
MsgBox(strOutput, , "CountImagesExample")
End With 'ThisApplication.Engine
End Sub 'CountImagesExample
See Also