mirror of
https://github.com/voltbonn/profile-picture-generator.git
synced 2024-12-22 15:55:08 +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.width = frameSize
|
||||||
offscreenCanvas.height = frameSize
|
offscreenCanvas.height = frameSize
|
||||||
|
|
||||||
const offscreenCanvas_ctx = offscreenCanvas.getContext('2d', { alpha: false })
|
|
||||||
|
|
||||||
const width = frameSize
|
const width = frameSize
|
||||||
const height = (img.height / img.width) * frameSize
|
const height = (img.height / img.width) * frameSize
|
||||||
|
const offscreenCanvas_ctx = offscreenCanvas.getContext('2d', { alpha: true })
|
||||||
offscreenCanvas_ctx.drawImage(
|
offscreenCanvas_ctx.drawImage(
|
||||||
img,
|
img,
|
||||||
(frameSize - width) / 2,
|
(frameSize - width) / 2,
|
||||||
|
|
Loading…
Reference in a new issue