Get image settings like the brightness value

How can I get the brightness value from display settings (tab Adjust) and set it in a variable? I want to use it in a macro to set the brightness automatically.

Thanks in advance.
fsup

Comments

  • Hi fsup,

    You can use LookupTable property of McImage, like this:

        Public Function AdjustLUT
            With ThisApplication.ActiveImage.LookupTable
                .Brightness=55
                .Contrast=60
                .BlackLevel=20
                .WhiteLevel=200
                .Realize
            End With
        End Function
    

    Yuri

  • Hi Yuri,

    Thank you for your suggestion. Now I can read out the brightness value.

        Public Sub GetDisplayBrightness
            MsgBox ThisApplication.ActiveImage.LookupTable.Brightness.ToString
        End Sub
    How can I do this with an ImageSet?

    fsup

  • Hi fsup,

    If you are not in Color Composite mode, then you can use similar macro to set LUT for the image at the active location of the image set (you must have a reference to MediaCy.IQL.Sets in your macro):

        Public Sub AdjustLUTImageSet
            Dim imSet As McImageSet=ThisApplication.ActiveDocument.Data
            If imSet Is Nothing Then Exit Sub   'not image set
            Dim im As McImage=imSet.GetSourceAtLocation(imSet.GetCurrentLocation,mcImageSetLocationMatchTypes.mcislmtExact).Image
            With im.LookupTable
                .Brightness=33
                .Contrast=48
                .BlackLevel=25
                .WhiteLevel=210
                .Realize
            End With
        End Sub
    

    Yuri
  • Hi Yuri,

    you are great. It works.
    Thank you very much.

    fsup
Sign In or Register to comment.