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

福州公司网站seo 知乎

福州公司网站,seo 知乎,简单html网页制作代码,淄博做网站建设公司【HarmonyOS NEXT】实现截图功能 【需求】 实现:实现点击截图按钮,实现对页面/组件的截图 【步骤】 编写页面UI Entry Component struct Screenshot {BuildergetSnapContent() {Column() {Image().width(100%).objectFit(ImageFit.Auto).borderRadi…

【HarmonyOS NEXT】实现截图功能

【需求】

实现:实现点击截图按钮,实现对页面/组件的截图

【步骤】

  1. 编写页面UI
@Entry
@Component
struct Screenshot {@BuildergetSnapContent() {Column() {Image('').width('100%').objectFit(ImageFit.Auto).borderRadius(6)}.padding('10%').width('100%').height('100%').justifyContent(FlexAlign.Center).backgroundColor('rgba(0,0,0,0.5)').onClick(() => {})}@BuildergetIconUI() {Image($r('app.media.ic_snapshot')).width(20).aspectRatio(1).fillColor(Color.Black).margin({ right: 10 }).onClick(async () => {})}build() {Column({ space: 5 }) {Row() {Text('Hello Snapshot').fontSize(24)this.getIconUI()}.justifyContent(FlexAlign.SpaceBetween).padding(20).width('100%')Image('https://img20.360buyimg.com/img/jfs/t1/241153/31/4968/64736/65e53e56Fd3868b6e/b595d41ca8447ea4.jpg').width('60%').border({ width: 1, color: Color.Red }).borderRadius(8)Text('我是内容1')Text('我是内容2')Text('我是内容3')}.height('100%').width('100%').padding({ top: 50 }).backgroundColor(Color.White)}
}
  1. 导包
import { image } from '@kit.ImageKit';
import { componentSnapshot } from '@kit.ArkUI';
  1. 给需要快照的组件设置id
Column(){}.id('page')
  1. 点击调api实现截图效果
Image($r('app.media.ic_snapshot')).onClick(async () => {this.snapshotImage = await componentSnapshot.get('page')this.showSnap = !this.showSnap // 显示截屏// Todo: 截屏音效// Todo: 保存到相册})

【完整代码】

import { image } from '@kit.ImageKit';
import { componentSnapshot } from '@kit.ArkUI';@Entry
@Component
struct Screenshot {@State snapshotImage: image.PixelMap | null = null@State showSnap: boolean = false@BuildergetSnapContent() {Column() {Image(this.snapshotImage).width('100%').objectFit(ImageFit.Auto).borderRadius(6)}.padding('10%').width('100%').height('100%').justifyContent(FlexAlign.Center).backgroundColor('rgba(0,0,0,0.5)').onClick(() => {this.showSnap = false})}@BuildergetIconUI() {Image($r('app.media.ic_snapshot')).width(20).aspectRatio(1).fillColor(Color.Black).margin({ right: 10 }).onClick(async () => {this.snapshotImage = await componentSnapshot.get('page')this.showSnap = !this.showSnap // 显示截屏// Todo: 截屏音效// Todo: 保存到相册})}build() {Column({ space: 5 }) {Row() {Text('Hello Snapshot').fontSize(24)this.getIconUI()}.justifyContent(FlexAlign.SpaceBetween).padding(20).width('100%')Image('https://img20.360buyimg.com/img/jfs/t1/241153/31/4968/64736/65e53e56Fd3868b6e/b595d41ca8447ea4.jpg').width('60%').border({ width: 1, color: Color.Red }).borderRadius(8)Text('我是内容1')Text('我是内容2')Text('我是内容3')}.height('100%').width('100%').padding({ top: 50 }).backgroundColor(Color.White).id('page').bindContentCover($$this.showSnap, this.getSnapContent(), {modalTransition: ModalTransition.NONE})}
}

【效果图】

http://www.tj-hxxt.cn/news/96355.html

相关文章:

  • 网站网络营销怎么做百度一下百度一下百度一下
  • 南京网站建设企业青岛模板建站
  • 刘金鹏做网站靠谱吗企业网站建设优化
  • 珠海做网站的公司有哪些推广类软文
  • 外包制作app百度seo推广优化
  • 如何做外贸soho做网站百度网盘搜索免费资源
  • 网站收录怎么设置广州快速排名
  • wordpress网站语言包优化加速
  • 0元购怎么在网站做广告推广的软件
  • 广州工商登记北京seo培训
  • blog网站建设高端网站定制设计
  • 小说网站怎么做权重批量查询权重
  • 制作网站软件教程博客是哪个软件
  • 自己做网站如何赚钱百度关键字
  • 动易后台 网站统计调查 报表类型怎样使用免费b2b网站推广渠道
  • 日本平面设计大师个人网站免费网络推广工具
  • 美食网页设计图网站的排名优化怎么做
  • 做视频怎么去除网站成功营销案例100例
  • 华为企业建设网站的目的正规淘宝代运营去哪里找
  • 江西东乡网站建设石家庄网站建设
  • 淄博晨曦网站建设百度一下你就知道官网网址
  • 如何建好一个网站seo推广有哪些
  • web在线编辑器企业seo培训
  • 广东潮阳疫情最新郑州seo技术
  • 个人做商贸网站怎么创建一个自己的网站
  • 做网站一定要后台嘛下拉词排名
  • 一个在线做笔记的网站百度知道免费提问
  • 电子商务专业学什么廊坊关键词排名优化
  • wordpress tag链接优化seo是免费的吗
  • b2b网站代表及网站网址是什么电商平台引流推广