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

网页设计公司注册360优化大师官方最新

网页设计公司注册,360优化大师官方最新,以前做的网站怎么才能登陆后台,吴志国网站建设工作室ArkTS卡片开放了自定义绘制的能力,在卡片上可以通过Canvas组件创建一块画布,然后通过CanvasRenderingContext2D对象在画布上进行自定义图形的绘制,如下示例代码实现了在画布的中心绘制了一个笑脸。 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.ds6.com.cn/news/107553.html

相关文章:

  • 网站编程源码免费软文写手
  • 邢台网站网页设计公司友链交易
  • 怎么做app软件开发扬州seo推广
  • 业务代刷平台网站怎么做衡阳网站优化公司
  • 小创业公司网站怎么做江东seo做关键词优化
  • office做网站的杭州网站建设技术支持
  • 香港特别行政区土地面积工具站seo
  • 建设网站编程语言怎么提高关键词搜索权重
  • 佛山论坛建站模板郑州谷歌优化外包
  • 网站服务器可以做家用电脑网站收录查询系统
  • 制作网站需要注意什么网站seo关键词设置
  • 超值的镇江网站建设互联网产品运营
  • 网站建设开发公司哪家好求职seo
  • 开题报告旅游网站开发5g站长工具查询
  • 网站建设小企业案例seo是搜索引擎营销吗
  • 沈阳做网站哪家公司好做seo推广一年大概的费用
  • 枣强网站建设地推是什么
  • 音乐网站建设目标今日头条指数查询
  • 宿迁环保局网站建设局搜索引擎推广的三种方式
  • 乌海网站开发广州百度网站快速排名
  • 魏县网站建设推广专业的google推广公司
  • 增长超人做网站多少钱seo站
  • python做网站例子方象科技的服务范围
  • 大学网站建设课程课综纯手工seo公司
  • 安阳网站优化公司推荐推广渠道有哪些方式
  • wordpress 标题栏置顶郴州seo外包
  • 懒人学做网站制作网站代码
  • 网站可以用什么语言开发做百度竞价推广运营
  • 成都网站建制作百度导航怎么下载
  • ubc网站谁做的怎么做网站主页