var example = {};
example.rotate = function (context) {
context.beginPath();
context.rotate(10*Math.PI/180);
context.rect(225, 75, 20, 10);
context.fill();
};
example.scale = function (context) {
context.beginPath();
context.rect(25, 25, 50, 50);
context.stroke();
context.scale(2,2);
context.beginPath();
context.rect(25, 25, 50, 50);
context.stroke();
};
example.reset = function (context) {
context.beginPath();
context.setFillStyle('#000000');
context.setStrokeStyle('#000000');
context.setFontSize(10);
context.setShadow(0, 0, 0, 'rgba(0, 0, 0, 0)');
context.setLineCap('butt');
context.setLineJoin('miter');
context.setLineWidth(1);
context.setMiterLimit(10);
};
example.translate = function (context) {
context.beginPath();
context.rect(10, 10, 100, 50);
context.fill();
context.translate(70, 70);
context.beginPath();
context.fill();
};
example.save = function (context) {
context.beginPath();
context.setStrokeStyle('#00ff00');
context.save();
context.scale(2, 2);
context.setStrokeStyle('#ff0000');
context.rect(0, 0, 100, 100);
context.stroke();
context.restore();
context.rect(0, 0, 50, 50);
context.stroke();
};
example.restore = function (context) {
[3, 2, 1].forEach(function (item) {
context.beginPath();
context.save();
context.scale(item, item);
context.rect(10, 10, 100, 100);
context.stroke();
context.restore();
});
};
example.drawImage = function (context) {
context.drawImage('/image/wechat.png', 0, 0);
};
example.fillText = function (context) {
context.setStrokeStyle('#ff0000');
context.beginPath();
context.moveTo(0, 10);
context.lineTo(300, 10);
context.stroke();
// context.save();
// context.scale(1.5, 1.5);
// context.translate(20, 20);
context.setFontSize(10);
context.fillText('Hello World', 0, 30);
context.setFontSize(20);
context.fillText('Hello World', 100, 30);
// context.restore();
context.beginPath();
context.moveTo(0, 30);
context.lineTo(300, 30);
context.stroke();
};
example.fill = function (context) {
context.beginPath();
context.rect(20, 20, 150, 100);
context.setStrokeStyle('#00ff00');
context.fill();
};
example.stroke = function (context) {
context.beginPath();
context.moveTo(20, 20);
context.lineTo(20, 100);
context.lineTo(70, 100);
context.setStrokeStyle('#00ff00');
context.stroke();
};
example.clearRect = function (context) {
context.setFillStyle('#ff0000');
context.beginPath();
context.rect(0, 0, 300, 150);
context.fill();
context.clearRect(20, 20, 100, 50);
};
example.beginPath = function (context) {
context.beginPath();
context.setLineWidth(5);
context.setStrokeStyle('#ff0000');
context.moveTo(0, 75);
context.lineTo(250, 75);
context.stroke();
context.beginPath();
context.setStrokeStyle('#0000ff');
context.moveTo(50, 0);
context.lineTo(150, 130);
context.stroke();
};
example.closePath = function (context) {
context.beginPath();
context.moveTo(20, 20);
context.lineTo(20, 100);
context.lineTo(70, 100);
context.closePath();
context.stroke();
};
example.moveTo = function (context) {
context.beginPath();
context.moveTo(0, 0);
context.lineTo(300, 150);
context.stroke();
};
example.lineTo = function (context) {
context.beginPath();
context.moveTo(20,20);
context.lineTo(20,100);
context.lineTo(70,100);
context.stroke();
};
example.rect = function (context) {
context.beginPath();
context.rect(20, 20, 150, 100);
context.stroke();
};
example.arc = function (context) {
context.beginPath();
context.arc(75,75,50,0,Math.PI*2,true);
context.moveTo(110,75);
context.arc(75,75,35,0,Math.PI,false);
context.moveTo(65,65);
context.arc(60,65,5,0,Math.PI*2,true);
context.moveTo(95,65);
context.arc(90,65,5,0,Math.PI*2,true);
context.stroke();
};
example.quadraticCurveTo = function (context) {
context.beginPath();
context.moveTo(20, 20);
context.quadraticCurveTo(20, 100, 200, 20);
context.stroke();
};
example.bezierCurveTo = function (context) {
context.beginPath();
context.moveTo(20, 20);
context.bezierCurveTo(20, 100, 200, 100, 200, 20);
context.stroke();
};
example.setFillStyle = function (context) {
['#fef957', 'rgb(242,159,63)', 'rgb(242,117,63)', '#e87e51'].forEach(function (item, index) {
context.setFillStyle(item);
context.beginPath();
context.rect(0 + 75*index, 0, 50, 50);
context.fill();
});
};
example.setStrokeStyle = function (context) {
['#fef957', 'rgb(242,159,63)', 'rgb(242,117,63)', '#e87e51'].forEach(function (item, index) {
context.setStrokeStyle(item);
context.beginPath();
context.rect(0 + 75*index, 0, 50, 50);
context.stroke();
});
};
example.setGlobalAlpha = function (context) {
context.setFillStyle('#000000');
[1, 0.5, 0.1].forEach(function (item, index) {
context.setGlobalAlpha(item)
context.beginPath();
context.rect(0 + 75*index, 0, 50, 50);
context.fill();
});
}
example.setShadow = function (context) {
context.beginPath();
context.setShadow(10, 10, 10, 'rgba(0, 0, 0, 199)');
context.rect(10, 10, 100, 100);
context.fill();
};
example.setFontSize = function (context) {
[10, 20, 30, 40].forEach(function (item, index) {
context.setFontSize(item);
context.fillText('Hello, world', 20, 20 + 40*index);
})
};
example.setLineCap = function (context) {
context.setLineWidth(10);
['butt', 'round', 'square'].forEach(function (item, index) {
context.beginPath();
context.setLineCap(item);
context.moveTo(20, 20 + 20*index);
context.lineTo(100, 20 + 20*index);
context.stroke();
});
};
example.setLineJoin = function (context) {
context.setLineWidth(10);
['bevel', 'round', 'miter'].forEach(function (item, index) {
context.beginPath();
context.setLineJoin(item);
context.moveTo(20 + 80*index, 20);
context.lineTo(100 + 80*index, 50);
context.lineTo(20 + 80*index, 100);
context.stroke();
});
};
example.setLineWidth = function (context) {
[2, 4, 6, 8, 10].forEach(function (item, index) {
context.beginPath();
context.setLineWidth(item);
context.moveTo(20, 20 + 20*index);
context.lineTo(100, 20 + 20*index);
context.stroke();
});
};
example.setMiterLimit = function (context) {
context.setLineWidth(4);
[2, 4, 6, 8, 10].forEach(function (item, index) {
context.beginPath();
context.setMiterLimit(item);
context.moveTo(20 + 80*index, 20);
context.lineTo(100 + 80*index, 50);
context.lineTo(20 + 80*index, 100);
context.stroke();
});
};
module.exports = example
没有合适的资源?快使用搜索试试~ 我知道了~
同乐居商城:购物车合算.zip小程序例子源码打包下载适合研究学习技术
共765个文件
js:183个
wxml:177个
wxss:138个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 46 浏览量
2022-03-13
03:55:21
上传
评论
收藏 1.13MB ZIP 举报
温馨提示
同乐居商城:购物车合算.zip小程序例子源码打包下载适合研究学习技术同乐居商城:购物车合算.zip小程序例子源码打包下载适合研究学习技术 1.适合学习做毕业设计参考模板。 2.适合程序员学习开发小程序研究用 3.适合小公司换皮做新项目参考使用用
资源推荐
资源详情
资源评论
收起资源包目录
同乐居商城:购物车合算.zip小程序例子源码打包下载适合研究学习技术 (765个子文件)
.DS_Store 8KB
.DS_Store 8KB
.DS_Store 6KB
.DS_Store 6KB
.DS_Store 6KB
.DS_Store 6KB
.DS_Store 6KB
.DS_Store 6KB
._.DS_Store 175B
._.DS_Store 175B
._.DS_Store 175B
._.DS_Store 175B
1.gif 48KB
1.gif 48KB
._1.gif 175B
dish-2.jpg 56KB
dish-2.jpg 56KB
dish-3.jpg 50KB
dish-3.jpg 50KB
dish-1.jpg 42KB
dish-1.jpg 42KB
dish-4.jpg 26KB
dish-4.jpg 26KB
dish-9.jpg 22KB
dish-9.jpg 22KB
dish-6.jpg 20KB
dish-6.jpg 20KB
dish-10.jpg 19KB
dish-10.jpg 19KB
dish-5.jpg 16KB
dish-5.jpg 16KB
dish-7.jpg 14KB
dish-7.jpg 14KB
dish-8.jpg 13KB
dish-8.jpg 13KB
1.jpg 7KB
1.jpg 7KB
2.jpg 7KB
2.jpg 7KB
._2.jpg 175B
._dish-8.jpg 175B
._dish-7.jpg 175B
._dish-3.jpg 175B
._dish-2.jpg 175B
._dish-10.jpg 175B
._dish-9.jpg 175B
._dish-5.jpg 175B
._dish-4.jpg 175B
._dish-6.jpg 175B
._dish-1.jpg 175B
._1.jpg 175B
example.js 7KB
example.js 7KB
index.js 4KB
index.js 4KB
menus.js 3KB
menus.js 3KB
background-audio.js 2KB
background-audio.js 2KB
voice.js 2KB
voice.js 2KB
animation.js 2KB
animation(1).js 2KB
index.js 2KB
index.js 2KB
on-accelerometer-change.js 2KB
on-accelerometer-change.js 2KB
storage.js 2KB
storage.js 2KB
label.js 1KB
label.js 1KB
file.js 1KB
file.js 1KB
image.js 1KB
image.js 1KB
video.js 1KB
video.js 1KB
canvas.js 1KB
canvas.js 1KB
input.js 899B
input.js 899B
button.js 805B
button.js 805B
canvas.js 716B
canvas.js 716B
scroll-view.js 692B
scroll-view.js 692B
swiper.js 679B
swiper.js 679B
form.js 647B
form.js 647B
get-user-info.js 602B
get-user-info.js 602B
action-sheet.js 576B
action-sheet.js 576B
cert.js 572B
cert.js 572B
slide-tab.js 536B
slide-tab.js 536B
map.js 530B
共 765 条
- 1
- 2
- 3
- 4
- 5
- 6
- 8
资源评论
yxkfw
- 粉丝: 76
- 资源: 2万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功