如何使用html5 canvas元素绘制透明图像 [英] How to draw transparent image with html5 canvas element

查看:1027
本文介绍了如何使用html5 canvas元素绘制透明图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我定位的是Google Chrome。是否可以在画布上绘制透明图像?透明我的意思是在像50%不透明度的东西绘制整个图像。

I am targeting google chrome. Is it possible to draw transparent images on a canvas? By transparent I mean the drawing the entire image at something like 50% opacity.

推荐答案

画布元素有一个全局alpha属性,可让您对绘制的任何部分应用部分透明。请参阅: whatwg

The canvas element has a global alpha attribute that lets you apply partial transparency to anything you draw. See: whatwg.

这篇关于如何使用html5 canvas元素绘制透明图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆