I have poked at INVISIBLE IMAGES a bit and it seems like the COST / BENEFIT on this feature is heavy on the COST side.
If time allows, I'll return to this aspect of the program (eliminating images flashing on and off the screen) after all other aspects of the program are working properly.
Perhaps this topic is one that could be covered in a PREMIER PROGRAMMERS WEBINAR.
I just attempted to use the CODE below to make an IMAGE INVISIBLE to speed up some work. My intention was to set the value to TRUE after the SLOW CODE was finished. Unfortunately it seems that this command is still closing the image rather than hiding it.
If the image is already opened in the workspace and assigned to a document, you cannot hide it, only delete. You can set Visible=False to images that are going to be created. So, what you can do is to create a duplicate, invisible version of the active image, do all the processing on it and only in the end show it.
Public Function CountInvisible() As SimpleScript
CountInvisible = New SimpleScript
Dim image1
With Adjust.ImageCommands.Crop(CountInvisible)
'create invisible duplicate of the active image
.Visible = False
.Run(ThisApplication.ActiveImage, image1)
End With
'do some processing on invisible image
'count
With Measure.MeasurementsCommands.ExecuteCount(CountInvisible)
.Run(image1)
End With
'... do more processing
'show the image in the end
image1.Visible=True
End Function
and lower level equivalent of that macro:
Public Function CountInvisible2
Dim image1 As McImage=ThisApplication.ActiveImage.Duplicate(mcImageCreateFlags.mcicfNotVisible)
With New Mediacy.Addins.Measurements.CountCommand
.Run(image1)
End With
image1.Visible=True
End Function
Answers
When you open invisible image you get a pointer to the IMcDocument,
With Measure.Measurements.OptionsCommands.Open(LoopOnHidden) .FileName = ThisApplication.Path(mcPathType.mcptConfigurationFiles) & "FD_Oprindelig.iqo" .FilterIndex = 1 .Visible = False .Run(doc1) End With
doc1 in this case. The Data property of IMcDocument returns McImage, so if you use
doc1.Data.Visible = True
it will make that invisible image visible.
Yuri
Yuri --
Thank you for the information.
I have poked at INVISIBLE IMAGES a bit and it seems like the COST / BENEFIT on this feature is heavy on the COST side.
If time allows, I'll return to this aspect of the program (eliminating images flashing on and off the screen) after all other aspects of the program are working properly.
Perhaps this topic is one that could be covered in a PREMIER PROGRAMMERS WEBINAR.
Thanks.
-- Matt
If the image is already opened in the workspace and assigned to a document, you cannot hide it, only delete. You can set Visible=False to images that are going to be created.
So, what you can do is to create a duplicate, invisible version of the active image, do all the processing on it and only in the end show it.
and lower level equivalent of that macro:
Yuri
- Do processing and counting on IMAGE AA
- Save a copy of AA as TIF IMAGE BB so that BB contains the thousands of features found in AA
- Open BB as INVISIBLE and perform the graphic intensive operation on the features
- Close IMAGE AA
- Make BB VISIBLE so that the processed features from AA are now on the screen
I will try this and see if this is faster than just working on AA in the visible mode.