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

网站建设存在风险莱芜网站设计公司

网站建设存在风险,莱芜网站设计公司,学校网站建设行业现状,临沂医院手机网站建设ArkTS卡片开放了自定义绘制的能力#xff0c;在卡片上可以通过Canvas组件创建一块画布#xff0c;然后通过CanvasRenderingContext2D对象在画布上进行自定义图形的绘制#xff0c;如下示例代码实现了在画布的中心绘制了一个笑脸。 Entry Component struct Card { private c…ArkTS卡片开放了自定义绘制的能力在卡片上可以通过Canvas组件创建一块画布然后通过CanvasRenderingContext2D对象在画布上进行自定义图形的绘制如下示例代码实现了在画布的中心绘制了一个笑脸。 Entry Component struct Card { private canvasWidth: number 0; private canvasHeight: number 0; // 初始化CanvasRenderingContext2D和RenderingContextSettings private settings: RenderingContextSettings new RenderingContextSettings(true); private context: CanvasRenderingContext2D new CanvasRenderingContext2D(this.settings);build() { Column() { Row() { Canvas(this.context) .margin(5%) .width(90%) .height(90%) .onReady(() { console.info([ArkTSCard] onReady for canvas draw content); // 在onReady回调中获取画布的实际宽和高 this.canvasWidth this.context.width; this.canvasHeight this.context.height; // 绘制画布的背景 this.context.fillStyle rgba(203, 154, 126, 1.00); this.context.fillRect(0, 0, this.canvasWidth, this.canvasHeight); // 在画布的中心绘制一个红色的圆 this.context.beginPath(); let radius this.context.width / 3 let circleX this.context.width / 2 let circleY this.context.height / 2 this.context.moveTo(circleX - radius, circleY); this.context.arc(circleX, circleY, radius, 2 * Math.PI, 0, true); this.context.closePath(); this.context.fillStyle red; this.context.fill(); // 绘制笑脸的左眼 let leftR radius / 4 let leftX circleX - (radius / 2) let leftY circleY - (radius / 3.5) this.context.beginPath(); this.context.arc(leftX, leftY, leftR, 0, Math.PI, true); this.context.strokeStyle #ffff00 this.context.lineWidth 10 this.context.stroke() // 绘制笑脸的右眼 let rightR radius / 4 let rightX circleX (radius / 2) let rightY circleY - (radius / 3.5) this.context.beginPath(); this.context.arc(rightX, rightY, rightR, 0, Math.PI, true); this.context.strokeStyle #ffff00 this.context.lineWidth 10 this.context.stroke() // 绘制笑脸的嘴巴 let mouthR radius / 2.5 let mouthX circleX let mouthY circleY (radius / 3) this.context.beginPath(); this.context.arc(mouthX, mouthY, mouthR, Math.PI, 0, true); this.context.strokeStyle #ffff00 this.context.lineWidth 10 this.context.stroke() }) } }.height(100%).width(100%) } }
http://www.dnsts.com.cn/news/249212.html

相关文章:

  • 海南注册公司在哪个网站如何做简单的网站 域名邮箱
  • 南昌做网站后台投票wordpress 主查询
  • 做网站找模板如何安装网站程序
  • 徐州建站网站模板wordpress俄语
  • 磐安网站建设深圳龙岗房
  • 一流的镇江网站建设网站查询功能 技术支持 中企动力
  • 网站快速排名是怎么做的邢台哪里建网站
  • 网站建设工作流程新闻类软文营销案例
  • 济南网站建设推荐q479185700上快半路出家去学计算机网站开发
  • 长尾关键词爱站廊坊北京网站建设
  • 网站是怎么做的吗建设厅网站查询
  • 玉山网站制作软文营销公司
  • 专业外贸网站网络营销代运营服务
  • html5微网站陕西住房和城乡建设厅网站
  • 大连网站建设蛇皮果wordpress html标签可以
  • 网上服装定制网站什么叫网站收录
  • 河南网站推广企业管理培训课程名称
  • 珠海建设局网站首页泉港报名网站建设需要
  • 网站页面多大合适网站建设银行转账
  • 广州高端模板网站学院网站建设作用
  • 南京cms模板建站微信管理平台登录
  • 深圳58同城招聘网最新招聘信息张家界seo排名
  • 推广网站公司网络广告推广策划
  • 个人备案能公司网站网页设计培训 周末双休
  • 我要建一个网站为什么wordpress样式无效
  • 建设网站所需的费用的估算建筑行业教育培训平台
  • 做网站要准备哪些素材维护网站建设空间出租
  • 网站建设方案 流程建立网站的英文
  • 网站seo的关键词排名怎么做的网站关键词太多好不好
  • 用dedecms织梦做中英文网站邯郸注册公司