Description

  • Description of the image widget

Interface version

Version number Writer Date Description
1.0 Qin Zhitian June 29, 2021 initial release

IP address

http://192.168.1.1/wapi

API list

Name Description
set set attributes
get get attributes

1. set

Description of request parameters

Parameter Name Type Description
attr string attribute
attr.type string type:event_click-‘click-event trigger’;transparency-‘set image transparency’; zoom-‘set the zoom factor for an image’;re_color-‘set image RGB’;img_rotate-‘set image rotation’;
attr.value int parameter:zoom-‘zoom factor’;transparency-‘transparency value’;img_rotate-‘rotation angle 0-3600’;
attr.recoloring_R int parameter: the value of R
attr.recoloring_G int parameter: the value of G
attr.recoloring_B int parameter: the value of B

Call example

{
    "wid": "s1",
    "cmd" : "set",
    "attr": {
        "type": "event_click"
    }
}
Note: click an image to trigger an event callback;
{
    "wid": "s1",
    "cmd" : "set",
    "attr": {
            "type": "zoom",
            "value": 500
    }
}
Note: set the zoom factor of the image to 500 (no zoom value is 256);
{
    "wid": "s1",
    "cmd" : "set",
    "attr": {
            "type": "transparency",
            "value": 200
    }
}
Note: set the image transparency to 200;
{
    "wid": "s1",
    "cmd" : "set",
    "attr": {
            "type": "re_color",
            "color_R": 255,
            "color_G": 255,
            "color_B": 255
    }
}
Note: set the image color as R: 255, B: 255, G: 255;
{
    "wid": "s1",
    "cmd" : "set",
    "attr": {
            "type": "img_rotate",
            "value": 500
    }
}
Note: set the image rotation to 50 degrees;

Return example

{
    "code": 0
}

Description of return parameters

Parameter Name Type Description
result string result information
result.code int error code

Error Code

Error Code Description

2. get

Description of request parameters

Parameter Name Type Description

Call example

{
    "wid": "s1",
    "cmd" : "get"
}

Return example

{
    "zoom": 256,
    "code": 0
}

Description of return parameters

Parameter Name Type Description
result string result information
result.code int error code
result.zoom int zoom factor

Error Code

Error Code Description
文档更新时间: 2021-08-18 22:39   作者:plj