mirror of
https://github.com/voltbonn/profile-picture-generator.git
synced 2024-12-21 23:35:05 +00:00
use opacity when generating the image
This commit is contained in:
parent
a69d190fe9
commit
2dd926cbbb
1 changed files with 1 additions and 1 deletions
|
@ -27,10 +27,10 @@ function App() {
|
|||
offscreenCanvas.width = frameSize
|
||||
offscreenCanvas.height = frameSize
|
||||
|
||||
const offscreenCanvas_ctx = offscreenCanvas.getContext('2d', { alpha: false })
|
||||
|
||||
const width = frameSize
|
||||
const height = (img.height / img.width) * frameSize
|
||||
const offscreenCanvas_ctx = offscreenCanvas.getContext('2d', { alpha: true })
|
||||
offscreenCanvas_ctx.drawImage(
|
||||
img,
|
||||
(frameSize - width) / 2,
|
||||
|
|
Loading…
Reference in a new issue