Created
May 16, 2020 08:25
-
-
Save andion/a0d077d12c49ecb46b3ae013eff6c59c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Get our canvas and image | |
const canvas = document.getElementById("canvas"); | |
const image = document.getElementById("source"); | |
const ctx = canvas.getContext("2d"); | |
// Our new ratio and source image width/height | |
const transformedRatio = 3/4; | |
const {naturalWidth: originalWidth, naturalHeight: originalHeight} = image; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment