当前位置: 首页 > news >正文

网站建设中的图片安卓小程序开发入门

网站建设中的图片,安卓小程序开发入门,全网营销网站,qq官网登录入口手机版展示全屏截图和屏幕局部截图。通过[screenshot]模块实现屏幕截图 #xff0c;通过[window]模块实现隐私窗口切换#xff0c;通过[display]模块查询当前隐私窗口。 效果预览 全屏截图局部截图选择区域局部截图 使用说明#xff1a; 点击右上角图标打开弹窗#xff0c;选…展示全屏截图和屏幕局部截图。通过[screenshot]模块实现屏幕截图 通过[window]模块实现隐私窗口切换通过[display]模块查询当前隐私窗口。 效果预览 全屏截图局部截图选择区域局部截图 使用说明 点击右上角图标打开弹窗选择截屏展示全屏截图选择局部截屏选择截屏区域点击右下角完成展示局部截屏点击滑块切换窗口隐私模式隐私模式下截屏会弹出提示拒绝截屏。 具体实现 本示例通过screenshot接口实现屏幕截图 通过window接口实现隐私窗口切换通过display接口查询当前隐私窗口。 源码链接[Screenshot.ets] /** Copyright (c) 2022 Huawei Device Co., Ltd.* Licensed under the Apache License, Version 2.0 (the License);* you may not use this file except in compliance with the License.* You may obtain a copy of the License at** http://www.apache.org/licenses/LICENSE-2.0** Unless required by applicable law or agreed to in writing, software* distributed under the License is distributed on an AS IS BASIS,* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.* See the License for the specific language governing permissions and* limitations under the License.*/import screenshot from ohos.screenshotimport { Logger } from ./Loggerimport { getCurrentWindow } from ./WindowPrivacy// 屏幕截图 默认参数screenshotOptions为空时 截全屏export function getScreenshot(screenshotOption {}) {return screenshot.save(screenshotOption)}// 设置全屏展示 isFullScreen: booleanexport function setFullScreen(context: Context, isFullScreen: boolean) {getCurrentWindow(context).then(res {res.setFullScreen(isFullScreen, (err) {if (err.code) {Logger.error(failed set full-screen mode cause: JSON.stringify(err))return}Logger.info(success set full-screen mode)})})}[WindowPrivacy.ets] /** Copyright (c) 2022 Huawei Device Co., Ltd.* Licensed under the Apache License, Version 2.0 (the License);* you may not use this file except in compliance with the License.* You may obtain a copy of the License at** http://www.apache.org/licenses/LICENSE-2.0** Unless required by applicable law or agreed to in writing, software* distributed under the License is distributed on an AS IS BASIS,* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.* See the License for the specific language governing permissions and* limitations under the License.*/import window from ohos.windowimport display from ohos.displayimport { ResponseData } from ../models/ResponseDataimport { Logger } from ./Logger// 获取当前窗口export function getCurrentWindow(context: Context) {return window.getTopWindow(context)}// 判断隐私窗口export function hasPrivate(): ResponseData {let currentDisplay nulltry {currentDisplay display.getDefaultDisplaySync()} catch (exception) {return { status: failed, errorMessage: JSON.stringify(exception) }}if (currentDisplay null) {return { status: failed, errorMessage: get current display failed }}let ret undefinedtry {ret display.hasPrivateWindow(currentDisplay.id)} catch (exception) {return { status: failed, errorMessage: JSON.stringify(exception) }}if (ret undefined) {return { status: failed, errorMessage: ret is undefined }}return ret ? { status: success, errorMessage: , result: true } :{ status: success, errorMessage: , result: false }}// 设置隐私窗口export function setWindowPrivacyMode(context: Context, windowPrivacyMode: boolean) {let currentWindow nullgetCurrentWindow(context).then(res {currentWindow restry {currentWindow.setWindowPrivacyMode(windowPrivacyMode, (err) {if (err.code) {Logger.error(set window privacy mode failed cause: JSON.stringify(err))return}Logger.info(set window privacy mode success ${windowPrivacyMode})})} catch (exception) {Logger.info(set window mode failed cause: JSON.stringify(exception))}})}鸿蒙OpenHarmony知识已更新←前往
http://www.pierceye.com/news/714069/

相关文章:

  • 什么网站能免费做简历ui设计师是什么意思
  • 天津网站推广公司哪家好深圳公司注册流程及资料
  • 家装网站建设哪家好点赣州市南康建设局网站
  • 北京建设网站制作我国外贸网站的建设
  • 自己做网站如何赚钱excel做网站
  • 芯片商城网站建设wordpress批量替换图片路径
  • 网站添加手机站软件 项目管理系统
  • 大理装饰公司做网站网站建设费用:做个网站要多少钱?
  • 简约的网站设计界面百度收录网站左侧图片
  • 对建设网站未来发展的建议教育 网站模板
  • 做篮球网站用的背景图广州黄埔做网站的公司
  • 爱客源seo怎么刷关键词排名
  • 自己做网站网页文件在哪里公司官网定制
  • 网站建设怎么样工作室哪个网站可以免费制作h5
  • 做网站学的是代码吗机器封所有端口 不支持做网站
  • 类似于美团的网站开发两学一做网站专栏怎么设置
  • 天津seo网站管理千川推广官网
  • 技术支持 光速东莞网站建设企业信息免费查询系统
  • 网站设计主流尺寸weui wordpress模板
  • 汕头市网站建设商机互联网站建设
  • 口碑好的网站建设苏州园区做网站公司
  • 网站互联网设计图风格网站服务器异常是什么意思
  • 有哪些好的做兼职网站有哪些免费做ppt的网站
  • 学生成绩管理系统网站建设上海公共招聘网12333官网
  • 邵东做网站的公司wordpress修改文章字体颜色
  • 那个网站百度收录快天河高端网站建设
  • 网站建设 客户拜访wordpress设置新页面
  • 做百度推广送的网站网站建设中gif
  • 网站风格介绍wordpress怎么给产品编号
  • 站长聚集地深圳网络提速优化服务包