Click or drag to resize

IMcImageVisible Property

Determines whether the image is visible in the application.

Namespace:  MediaCy.IQL.Engine
Assembly:  MediaCy.IQL.Engine (in MediaCy.IQL.Engine.dll) Version: 10.0.6912.0
Syntax
VB
Property Visible As Boolean
	Get
	Set

Property Value

Type: Boolean
Remarks
When Visible is set to True, the image will be displayed in an application workspace. When Visible is set to False, the image's workspaces will be closed. If the image is not part of the Application.Images collection when Visible is set True, then it is first added to that collection before being made visible. If Visible was True and is set False, then the image is removed from the Application.Images collection if it was part of it. At this time the image will be destroyed unless a reference is being held on the McImage instance (see Example 1). Note that when an image is destroyed by setting Visible=False (or by calling Close), the user is not queried as to whether they want to save a Modified image. If you want that behavior, you need to call McWindow.Close to close the last window open on the image (see Example 2). On assigment a PropertyChanged(ID_IMcImage_Visible) event is fired.
Examples
VB
'Example 1.  Make an image not Visible then Visible again
Debug.Assert ThisApplication.ActiveImage Is Nothing 'start example with no images
Dim myImage As McImage
Images.Open Path & "Images\BoneBig.jpg"
Windows.Add 'make two windows
'Keep a reference on this for the Visible=False then True test
Set myImage = ActiveImage
myImage.Visible = False 'close all windows and remove image from collection
Debug.Assert myImage.Collection Is Nothing
myImage.Visible = True 'show it again, which adds it back to the collection
Debug.Assert Not myImage.Collection Is Nothing
Set myImage = Nothing 'release our reference on the McImage
'close the image, which sets Visible=False and removes it from the collection
ThisApplication.ActiveImage.Close 'user will not be queried if the image is modified.
Debug.Assert ThisApplication.ActiveImage Is Nothing 'end with no images
'Example 2.  Ask the user if they want to save a Modified image
Images.Add "TestImage", 240, 200
Debug.Assert Not ThisApplication.ActiveImage.Modified 'new images are not Modified
ThisApplication.ActiveImage.Clear Array(10, 10, 200, 150), 200
Debug.Assert ThisApplication.ActiveImage.Modified 'now it is Modified
Windows(ActiveImage).Close 'ask user to save the Modified image
See Also