Home Image-Pro General Discussions

How do I record the code to execute the functions triggered by the CAPTURE BOX + LIVE BUTTON

All --

IPP 9.1.4 seems to be having a problem during a RECORD MACRO that is being done to capture the functions triggered by the CAPTURE BOX + LIVE BUTTON.

The ERROR generated is

    Error in Image-Pro Premier 64-bit
    Object reference not set to an instance of an object.

I think this is something that I've worked around in the past but I'm not having good luck finding it in my code library.

The same thing happens when trying to RECORD the functions triggered by the CAPTURE BUTTON.

Any suggestions?

Oh . . .

I am using a SIMULATED CAMERA.  Perhaps this is the issue.

Thanks.

-- Matt

Best Answer

Answers

  • Pierre --

    Thank you for directing me to DISCUSSION 1136.

    I was able to use the information there to address my needs.

    Thanks again.

    -- Matt
  • All --

    Here is the code that I generated for a LIVE and a CAPTURE button within my APPLICATION.

    Please note that:

    1) Both of these routines close any images that are open when this code is triggered.
    2) My LIVE routine closes the image frozen with the PREVIEW is turned OFF (unlike the "real" PREMIER LIVE BUTTON)

    I hope this helps to recharge the zen.

    -- Matt

        Private Sub button_Live_Click(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles button_Live.Click
    
            'Declare local variables
            Dim image1
    
            'Close all open images without prompting the user
            CloseAllForm.ClosingAllAction=CloseAllForm.CloseAllFormAction.actionNoAll
            ThisApplication.Windows.CloseAll()
    
            'Connect with the appropriate function
            With Capture.CaptureCommands.Preview(Nothing)
    
                'If the PREVIEW is OFF
                If (.previewon = False) _
                    Then
    
                        'Turn the PREVIEW ON
                        .PreviewOn = True
                        .Run(Nothing,image1)
    
                    Else
    
                        'Turn the PREVIEW OFF
                        .PreviewOn = False
                        .Run(Nothing,image1)
    
                    End If
    
            End With
    
            'Close all open images without prompting the user
            CloseAllForm.ClosingAllAction=CloseAllForm.CloseAllFormAction.actionNoAll
            ThisApplication.Windows.CloseAll()
    
        End Sub
    
        Private Sub button_Capture_Click(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles button_Capture.Click
    
            'Declare local variables
            Dim image1
    
            'Close all open images without prompting the user
            CloseAllForm.ClosingAllAction=CloseAllForm.CloseAllFormAction.actionNoAll
            ThisApplication.Windows.CloseAll()
    
            'Connect with the appropriate function
            With Capture.CaptureCommands.Preview(Nothing)
    
                'If the PREVIEW is OFF
                If (.previewon = False) _
                    Then
    
                        'Turn the PREVIEW ON
                        .PreviewOn = True
                        .Run(Nothing,image1)
    
                    End If
    
            End With
    
            'Connect with the appropriate function
            With Capture.CaptureCommands.Preview(Nothing)
    
                'Turn the PREVIEW OFF (to FREEZE the image)
                .PreviewOn = False
                .Run(Nothing,image1)
    
            End With
    
        End Sub
    


Sign In or Register to comment.