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

Controlling THRESHOLD DIALOG BOX . . .

All

I can show the THRESHOLD DIALOG BOX with this code

        'DISPLAY THE THRESHOLD DIALOG BOX
        With Measure.ThresholdTool.Gadgets.Histogram(Nothing)
            .CheckState = MediaCy.IQL.Application.McCommand.mcCheckState.Checked
            .Run()
        End With

and I can hide the THRESHOLD DIALOG BOX with this code

        'HIDE THE THRESHOLD DIALOG BOX
        With Measure.ThresholdTool.Gadgets.Histogram(Nothing)
            .CheckState = MediaCy.IQL.Application.McCommand.mcCheckState.unchecked
            .Run()
        End With
but I do not seem to be able to use

    Measure.ThresholdTool.Gadgets.Histogram(Nothing).CheckState
    or
    Measure.ThresholdTool.Gadgets.Histogram(Nothing).Checked

to see if the THRESHOLD BOX is showing or hiding.

What CODE works to determine whether the THRESHOLD DIALOG BOX is SHOWING or HIDING?

Thanks.

-- Matt

Best Answer

  • Options
    Answer ✓
    Hi Matt,

    You should use this macro to see if the dialog is shown or not:
        Public Sub GetThresholdVisible
            Debug.Print (ThisApplication.Panels.Control("ThresholdTool") IsNot Nothing)
        End Sub
    

    Yuri

Answers

  • Options
    Hi Matt,

    Your code looks correct and in my tests the following macro hides the dialog properly:

        Public Sub HideThreshold
            With Measure.ThresholdTool.Gadgets.Histogram(Nothing)
                .CheckState = MediaCy.IQL.Application.McCommand.mcCheckState.Unchecked
                .Run()
            End With
        End Sub
    

    Please test again and let me know if you still have problems.

    Yuri
  • Options
    2018-11-19-100516

    Yuri --

    There is a mis-understanding.

    I am looking for CODE that will tell me whether the TRESHOLD DIALOG BOX is OPEN/DISPLAYED or CLOSED/HIDDEN.

    If I repeat the

            'DISPLAY THE THRESHOLD DIALOG BOX
            With Measure.ThresholdTool.Gadgets.Histogram(Nothing)
                .CheckState = MediaCy.IQL.Application.McCommand.mcCheckState.Checked
                .Run()
            End With
    then the THRESHOLD DIALOG BOX flashes causes issues.

    I tried checking the VALUE of
    Measure.ThresholdTool.Gadgets.Histogram(Nothing).CheckState
    and
    Measure.ThresholdTool.Gadgets.Histogram(Nothing).CheckState.ToText
    with the THRESHOLD DIALOG BOX in both the OPEN/DISPLAYED and CLOSED/HIDDEN states and all I got back was

        INDETERMINATE

    Thank you for your assistance on this.

    -- Matt
  • Options
    2018-11-19-160436

    Yuri --

    Thank you for that CODE.

    I will try to add it to the APP to polish it up a bit tomorrow (TUE) AM.

    Thanks again.

    -- Matt


Sign In or Register to comment.