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

做网站.服务器怎么买wordpress admin密码md5

做网站.服务器怎么买,wordpress admin密码md5,企业邮箱登录入口腾讯,asp.net mvc6电商网站开发实践简单时钟 介绍 本示例通过使用ohos.display接口以及Canvas组件来实现一个简单的时钟应用。 效果预览 使用说明 1.界面通过setInterval实现周期性实时刷新时间,使用Canvas绘制时钟,指针旋转角度通过计算得出。 例如:"2 * Math.PI / …

简单时钟

介绍

本示例通过使用@ohos.display接口以及Canvas组件来实现一个简单的时钟应用。

效果预览

1

使用说明

1.界面通过setInterval实现周期性实时刷新时间,使用Canvas绘制时钟,指针旋转角度通过计算得出。

例如:"2 * Math.PI / 60 * second"是秒针旋转的角度。

具体实现

  • 本示例展示简单时钟的方法主要封装在Index中,源码参考:[Index.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 { display } from '@kit.ArkUI';
import Logger from '../utils/Logger';
import DrawClock from '../utils/DrawClock';
import CommonConstants from '../common/CommonConstants';const HEIGHT_ADD: number = CommonConstants.HEIGHT_ADD; // 表盘下面需要绘制时间,canvas高度是宽度加150
const TAG: string = 'Index';@Entry
@Component
struct Clock {@State canvasWidth: number = CommonConstants.DEFAULT_WATCH_SIZE; // 300是表盘默认大小private settings: RenderingContextSettings = new RenderingContextSettings(true);private context: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.settings);private radius: number = CommonConstants.DEFAULT_WATCH_RADIUS; // 默认表盘半径private intervalId: number = 0;private drawClock: DrawClock = new DrawClock();updateTime = () => {this.context.clearRect(0, 0, this.canvasWidth, this.canvasWidth + HEIGHT_ADD);let nowTime = new Date();let hour = nowTime.getHours();let minute = nowTime.getMinutes();let second = nowTime.getSeconds();let time = `${this.fillTime(hour)}:${this.fillTime(minute)}:${this.fillTime(second)}`;this.drawClock.drawClock(this.context, this.radius, this.canvasWidth, hour, minute, second, time)this.context.translate(-this.radius, -this.radius);}fillTime(time: number) {return time < CommonConstants.NUMBER_TEN ? `0${time}` : `${time}`;}onPageShow(): void {this.updateTime();this.intervalId = setInterval(this.updateTime, CommonConstants.INTERVAL_TIME)}onPageHide() {clearInterval(this.intervalId);}aboutToAppear() {this.getSize();}// 获取设备宽高计算表盘大小async getSize() {let mDisplay = display.getDefaultDisplaySync();Logger.info(TAG, `getDefaultDisplay mDisplay = ${JSON.stringify(mDisplay)}`);this.canvasWidth = px2vp(mDisplay.width > mDisplay.height ? mDisplay.height * CommonConstants.CONVERSION_RATE :mDisplay.width * CommonConstants.CONVERSION_RATE);this.radius = this.canvasWidth / CommonConstants.NUMBER_TWO;}build() {Stack({ alignContent: Alignment.Center }) {Canvas(this.context).padding({ top: $r('app.float.canvas_padding_top') }).width(this.canvasWidth).height(this.canvasWidth + HEIGHT_ADD).onReady(() => {this.updateTime();this.intervalId = setInterval(this.updateTime, CommonConstants.INTERVAL_TIME);})}.width(CommonConstants.FULL_PERCENTAGE).height(CommonConstants.FULL_PERCENTAGE)}
}
  • 设置表盘大小:通过Index中的display.getDefaultDisplay()方法来获取设备宽高计算表盘大小;
  • 获取当前时间:调用updateTime函数,执行new Date().getHours()、new Date().getMinutes()、new Date().getSeconds()获取当前时间。
  • 绘制表盘内容:通过CanvasRenderingContext2D来画表盘背景、时针、分针、秒针、圆心以及表盘下方文本;
  • 启动时钟:添加setInterval定时器,每隔1s执行一次updateTime函数。

以上就是本篇文章所带来的鸿蒙开发中一小部分技术讲解;想要学习完整的鸿蒙全栈技术。可以在结尾找我可全部拿到!
下面是鸿蒙的完整学习路线,展示如下:
1

除此之外,根据这个学习鸿蒙全栈学习路线,也附带一整套完整的学习【文档+视频】,内容包含如下

内容包含了:(ArkTS、ArkUI、Stage模型、多端部署、分布式应用开发、音频、视频、WebGL、OpenHarmony多媒体技术、Napi组件、OpenHarmony内核、鸿蒙南向开发、鸿蒙项目实战)等技术知识点。帮助大家在学习鸿蒙路上快速成长!

鸿蒙【北向应用开发+南向系统层开发】文档

鸿蒙【基础+实战项目】视频

鸿蒙面经

在这里插入图片描述

为了避免大家在学习过程中产生更多的时间成本,对比我把以上内容全部放在了↓↓↓想要的可以自拿喔!谢谢大家观看!

http://www.yayakq.cn/news/275774/

相关文章:

  • 大学网站建设工作总结国外工装设计网站大全
  • 资阳市建设局网站网上推广平台
  • 自己怎么做网站卖车门户网站建设公司方案
  • 创业服务网网站建设方案项目书新沂市建设局网站
  • 赌场网站建站做网站的云服务器选什么
  • 免费建设com网站dedecms制作的网站
  • 省建设厅官方网站wordpress首页全屏广告
  • 网站建设中所需条件oa系统审批流程
  • 威海城乡建设局网站首页wordpress怎么实现会员登录
  • 网站建设实践报告小结wordpress置顶
  • 长安网站建设网络推广开源模板网站
  • 网站建设公司的市场营销方案模板小程序怎么开发自己的小程序游戏
  • 公司网站用什么语言开发设计网页的步骤和规范
  • wordpress问答站模板wordpress带会员vip主题
  • 花生壳软件做的网站网站的分辨率
  • 铜仁建设局网站首页漳州seo搜索引擎优化多少钱
  • 邢台学校网站建设邯郸做网站的公司
  • 台州企业自助建站centos wordpress下载文件
  • 站长seo软件从哪里找外贸公司电话
  • 域名注册了 如何做网站网站建设邮箱免费自助建站
  • 阿里巴巴的电子商务网站建设搭建网站服务器平台的三种方式
  • 南通网站排名公司天河网站建设技术
  • 网站建设项目合同湖南网站营销seo哪家好
  • 湖北响应式网站制作重庆公司网站建设步骤
  • 网站怎么推广引流服装门户系统网站
  • 五个常见的电子商务网站wordpress英文版切换成中文
  • 便宜的购物网站排名网页设计首页怎么设计
  • 制定一网站建设的市场定位的方案网站优化哪里可以做
  • 谁能帮忙做网站备案比较著名的seo网站
  • 酒店网站模板设计方案专业网站排名优化