Home Image-Pro Plus Automation with Macros

Get Calibration Names

(Originally posted by Jims on 2/20/2006)


I can used the two command to get the active calibration name and system calibration name, and the two command as follow...

IpCalGet(ByVal, sAttrib)
IpICalGetLong(Calibration, Attribute, Value)

But I don't know the way how to get the all of calibration name.

Comments

  • (Originally posted by YuriG on 2/21/2006)

    You can get intensity calibration name using
    IpICalGetStr(CalID,ICAL_NAME,CalName)
    Here is the macro that prints names of all intensity calibrations:

    Sub GetICalibrationNames()

    Dim NCalibr As Long, i As Integer, CalID As Long, CalName As String*255

    ret=IpICalGetLong(0,ICAL_NUM_ALL,NCalibr)
    For i=0 To NCalibr-1
    ret=IpICalGetLong(i,ICAL_GET_ALL,CalID)
    ret=IpICalGetStr(CalID,ICAL_NAME,CalName)
    Debug.Print i+1 & " calibration name = " & IpTrim(CalName)
    Next i

    End Sub

  • (Originally posted by Jims on 2/21/2006)

    I modified the code in order to get the specified calibration name.

    Sub GetICalibrationNames()

    Dim NCalibr As Long, i As Integer, CalID As Long, CalName As String*255
    ret = IpSCalGetLong(0, SCAL_NUM_ALL, NCalibr)

    For i = 0 To NCalibr - 1
    ret = IpSCalGetLong(i, SCAL_GET_ALL, CalID)
    ret = IpSCalGetStr(CalID, SCAL_NAME, CalName)
    cmbCalib.AddItem IpTrim(CalName)
    Next i
    End Sub

    Then I Can run this sub in Image Pro Plus 5.1 Macro without problem.
    But this sub could not run in Visual Basic ImagePro Plugin Project.

    I think the ipc32.bas module maybe loss some declare function or variable.

  • (Originally posted by Chris Tully on 2/21/2006)

    Use a diff program (such as WinMerge) to compare the ipc32.bas files from the C:\IPWin51\BAS and C:\IPWin51\SDK\BAS folders. This will reveal any thing missing from the C:\IPWin51\SDK\BAS\ipc32.bas file. Note, that you do not want to just substitute the ipc32.bas from C:\IPWin51\BAS for the one from the SDK, but you can copy missing function declarations from one to the other. Pay attention to what you are doing though, because there are some critical differences in the two files.

     

Sign In or Register to comment.