1.noStatusScreenCapture

功能

对当前可见视图部分(无状态栏)进行截屏

参数

参数名 参数类型 参数描述 参数备注
callback function 回调函数 必填
type string 返回路径/base64 必填,0-文件路径,1-base64编码
isSaveToPhoto string 是否需要保存至相册 可选,0-不保存,1-保存,默认0

范例

/*
     * 无状态栏截屏
     * 参数type:0表示返回图片路径,1表示返回图片base64数据。
     * 参数isSaveToPhoto:0表示不保存截图至相册,1表示保存截图至相册。默认为0
     * */
    $("#noStatusScreenCapture").click(function() {
        var type = 0;
        var isSaveToPhoto = 1;
        WadeMobile.noStatusScreenCapture(function(path) {
            $("#screenCapture_path").html("回调结果:" + path);
            $("#screenCapture_pic").html("<img src='" + path + "' style='max-width:60%;'/>");
        },type,isSaveToPhoto);
    });

备注

2.fullScreenCapture

功能

对当前可见视图部分(含状态栏)进行截屏

参数

参数名 参数类型 参数描述 参数备注
callback function 回调函数 必填
type string 返回路径/base64 必填,0-文件路径,1-base64编码
isSaveToPhoto string 是否需要保存至相册 可选,0-不保存,1-保存,默认0

范例

 /*
     * 全屏截屏
     * 参数type:0表示返回图片路径,1表示返回图片base64数据。默认为0
     * 参数isSaveToPhoto:0表示不保存截图至相册,1表示保存截图至相册。默认为0
     * */
    $("#fullScreenCapture").click(function() {
        var type = 1;
        var isSaveToPhoto = 1;
        WadeMobile.fullScreenCapture(function(path) {
            $("#screenCapture_path").html("回调结果:" + path);
            $("#screenCapture_pic").html("<img src='"+ "data:image/jpeg;base64," + path + "' style='max-width:60%;'/>");
        },type,isSaveToPhoto);
    });

备注

3.handMovementScreenCapture

功能

可通过手势拖动/移动自定义截图范围

参数

参数名 参数类型 参数描述 参数备注
callback function 回调函数 必填
type string 返回路径/base64 必填,0-文件路径,1-base64编码
isSaveToPhoto string 是否需要保存至相册 可选,0-不保存,1-保存,默认0

范例

/*
     * 手动截屏
     * 参数type:0表示返回图片路径,1表示返回图片base64数据。默认为0
     * 参数isSaveToPhoto:0表示不保存截图至相册,1表示保存截图至相册。默认为0
     * */
    $("#handMovementScreenCapture").click(function() {
        WadeMobile.handMovementScreenCapture(function(path) {
            $("#screenCapture_path").html("回调结果:" + path);
            $("#screenCapture_pic").html("<img src='" + path + "' style='max-width:60%;'/>");
        },0,0);
    });

备注

4.webviewScreenCapture

功能

对当前Web视图(包括不可见部分)进行截图

参数

参数名 参数类型 参数描述 参数备注
callback function 回调函数 必填
type string 返回路径/base64 必填,0-文件路径,1-base64编码
isSaveToPhoto string 是否需要保存至相册 可选,0-不保存,1-保存,默认0

范例

/*
     * webview长图截屏
     * 参数type:0表示返回图片路径,1表示返回图片base64数据。默认为0
     * 参数isSaveToPhoto:0表示不保存截图至相册,1表示保存截图至相册。默认为0
     * */
    $("#webviewScreenCapture").click(function() {
        WadeMobile.webviewScreenCapture(function(path) {
            $("#screenCapture_path").html("回调结果:" + path);
            $("#screenCapture_pic").html("<img src='" + path + "' style='max-width:60%;'/>");
        },0,0);
    });

备注

Copyright © aiipu.com 2017 all right reserved,powered by Gitbook该文件修订时间: 2020-09-01 15:11:34

results matching ""

    No results matching ""