aboutsummaryrefslogtreecommitdiff
path: root/examples/camera/set_feature_value.py
blob: 7086d7567901b816628a40b660f9fe4836fb2386 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
from pymba import Vimba


FEATURE_NAME = 'PixelFormat'


if __name__ == '__main__':

    with Vimba() as vimba:
        camera = vimba.camera(0)
        camera.open()

        # read a feature value
        feature = camera.feature(FEATURE_NAME)
        value = feature.value

        # set the feature value (with the same value)
        feature.value = value

        print('"{}" was set to "{}"'.format(feature.name, feature.value))

        # alternatively the feature value can be set as an object attribute
        # note that this doesn't raise an error if the feature name doesn't exist
        camera.ExposureAuto = feature.value

        camera.close()