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

A way to update PREMIER IMAGE WINDOW . . .

All --

I have created CHECKBOXES within an APPLICATION to control the ROI OPTIONS of

    SHOWMASK
    and
    XORROIs

within PREMIER 9.1.4.

The code supporting these two CHECKBOXES is below.

When the SHOWMASK feature is ON then:

    ** Changing the XORROIs from OFF to ON via checkBox_ROIOptionXOR results in the proper ROI MASK being displayed
    ** Changing the XORROIs from ON to OFF via checkBox_ROIOptionXOR does not update the ROI MASK so the MASK is wrong

This is not remedied by turning the MASK OFF and ON again.

This behavior does not happen when XORROIs is turned from OFF to ON to OFF via the PREMIER (9.1.4) UI.

Is there a way to work around this issue?

Thanks.

-- Matt

*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
    Private Sub checkBox_ROIMask_CheckedChanged(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles checkBox_ROIMask.CheckedChanged

        'If the option is ON
        If ( checkBox_ROIMask.Checked ) _
            Then

                With Select.RoiCommands.ShowMask(Nothing)
                    .CheckState = MediaCy.IQL.Application.McCommand.mcCheckState.Checked
                    .Overlay = Overlays.OverlayType.ROIOverlay
                    .Run(ThisApplication.ActiveDocument)
                End With

            Else

                With Select.RoiCommands.ShowMask(Nothing)
                    .CheckState = MediaCy.IQL.Application.McCommand.mcCheckState.Unchecked
                    .Overlay = Overlays.OverlayType.ROIOverlay
                    .Run(ThisApplication.ActiveDocument)
                End With

            End If

    End Sub

    Private Sub checkBox_ROIOptionXOR_CheckedChanged(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles checkBox_ROIOptionXOR.CheckedChanged

        'If the option is ON
        If ( checkBox_ROIMask.Checked ) _
            Then

                With Select.RoiCommands.XORROIs(Nothing)
                    .CheckState = MediaCy.IQL.Application.McCommand.mcCheckState.Checked
                    .Run(ThisApplication.ActiveDocument)
                End With

            Else

                With Select.RoiCommands.XORROIs(Nothing)
                    .CheckState = MediaCy.IQL.Application.McCommand.mcCheckState.Unchecked
                    .Run(ThisApplication.ActiveDocument)
                End With

            End If

    End Sub

Best Answer

Answers

  • Nikita --

    Thank you for your response.

    After reading your message I looked closely at the code and found a programming error on my part was causing this issue.

    I found that my XORROI OPTION ROUTINE was checking the wrong CHECKBOX.  Changing
        Private Sub checkBox_ROIOptionXOR_CheckedChanged(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles checkBox_ROIOptionXOR.CheckedChanged
    
            'If the option is ON
            If ( checkBox_ROIMask.Checked ) _
    to
        Private Sub checkBox_ROIOptionXOR_CheckedChanged(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles checkBox_ROIOptionXOR.CheckedChanged
    
            'If the option has been turned ON
            If ( checkBox_ROIOptionXOR.Checked ) _
    resolved the (self generated) issue.

    The working versions of the routines are below.

    Sorry for the false alarm and thank you for checking this for me.

    -- Matt

    *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
        Private Sub checkBox_ROIMask_CheckedChanged(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles checkBox_ROIMask.CheckedChanged
    
            'If the option has been turned ON
            If ( checkBox_ROIMask.Checked ) _
                Then
    
                    With Select.RoiCommands.ShowMask(Nothing)
                        .CheckState = MediaCy.IQL.Application.McCommand.mcCheckState.checked
                        .Overlay = Overlays.OverlayType.ROIOverlay
                        .Run(ThisApplication.ActiveDocument)
                    End With
    
                Else
    
                    With Select.RoiCommands.ShowMask(Nothing)
                        .CheckState = MediaCy.IQL.Application.McCommand.mcCheckState.Unchecked
                        .Overlay = Overlays.OverlayType.ROIOverlay
                        .Run(ThisApplication.ActiveDocument)
                    End With
    
                End If
    
        End Sub
    
        Private Sub checkBox_ROIOptionXOR_CheckedChanged(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles checkBox_ROIOptionXOR.CheckedChanged
    
            'If the option has been turned ON
            If ( checkBox_ROIOptionXOR.Checked ) _
                Then
    
                    With Select.RoiCommands.XORROIs(Nothing)
                        .CheckState = MediaCy.IQL.Application.McCommand.mcCheckState.Checked
                        .Run(ThisApplication.ActiveDocument)
                    End With
    
                Else
    
                    With Select.RoiCommands.XORROIs(Nothing)
                        .CheckState = MediaCy.IQL.Application.McCommand.mcCheckState.UnChecked
                        .Run(ThisApplication.ActiveDocument)
                    End With
    
                End If
    
        End Sub
    

Sign In or Register to comment.