函数:operMerge 合并图像

函数分类:tsimg.so

函数功能:将多张图片合并为一张图像

函数方法

bool,msg = image.operMerge(tab,path,dir,quality)

参数 类型 必填 说明
tab table 需合并图片的文件名列表,只支持绝对路径
path string 输出路径,生成新图片的文件名,只支持绝对路径
dir number 合并类型,0 - 横向合并;1 - 竖向合并
quality number 当图片格式选为 jpg 时,可用此参数控制图片质量,
参数范围:0.1 - 1,不写或者写为 0 默认为 1
返回值 类型 说明
bool boolean true - 合并成功,false - 合并失败
msg string/nil 合并失败返回失败原因,合并成功返回空

函数用例

local image = require("tsimg")
snapshot("operMerge1.jpg", 100, 100, 200, 300)
snapshot("operMerge2.jpg", 200, 100, 300, 300)
snapshot("operMerge3.jpg", 300, 100, 400, 300)
local tab = {userPath() .. "/res/operMerge1.jpg",userPath() .. "/res/operMerge2.jpg",userPath() .. "/res/operMerge3.jpg"}
local path = userPath().."/res/operMerge4.jpg"
local dir = 1
local quality = 1
local bool, msg = image.operMerge(tab, path,dir, quality)
dialog(bool and "合并成功" or "合成失败:" .. msg,3)
Copyright 北京帮你玩科技有限公司 2023 all right reserved,powered by Gitbook该文章修订时间: 2024-03-06 17:50:18

results matching ""

    No results matching ""