Wang Xuan(雅萱)
Canvas 的 globalCompositeOperation 屬性
Try
HackMD
Wang Xuan(雅萱)
·
Follow
Last edited by
Wang Xuan(雅萱)
on
Oct 31, 2024
Linked with GitHub
Contributed by
0
Comments
Feedback
Log in to edit or delete your comments and be notified of replies.
Sign up
Already have an account? Log in
There is no comment
Select some text and then click Comment, or simply add a comment to this page from below to start a discussion.
Discard
Send
Canvas 的 globalCompositeOperation 屬性
用來設定合成類型,選項有以下這些:
source-over: 預設值,新的放在舊的上面
source-atop: 新的在舊的上面,然後會把新的身上沒有跟舊的重疊的部分變不見
source-in: 新的在舊的上面,然後只留下重疊的部分,其他都變不見(有點像打洞機打下去後得到的那個要丟掉的圓形)
source-out: 新的在舊的上面,然後會把舊的部分+重疊的部分都拿掉,只留下沒重疊到的新的內容(有點像裁切的概念)
destination-over: 新的在舊的下面
destination-atop: 新的在舊的下面,然後會把舊的身上沒有跟新的重疊的部分變不見
destination-in: 新的在舊的下面,然後只留下重疊的部分,其他都變不見(有點像打洞機打下去後得到的那個要丟掉的圓形)
destination-out: 新的在舊的下面,然後會把新的部分+重疊的部分都拿掉,只留下沒重疊到的舊的內容(有點像裁切的概念)
lighter: 新的在舊的上面,重疊部分高亮
copy: 直接把舊的變不見,只留下新的
xor: 新的在舊的上面,重疊的部分變不見(有點像打洞機打下去後得到的那張有洞的紙)
Canvas 的 globalCompositeOperation 屬性
Expand all
Back to top
Go to bottom
Canvas 的 globalCompositeOperation 屬性
Expand all
Back to top
Go to bottom
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up
Comment