Created
October 17, 2014 08:47
-
-
Save cjohansen/a6ba97342b6c0f06779e to your computer and use it in GitHub Desktop.
This file contains 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
function setPixelAspectRatio(ratio) { | |
var canvas = document.createElement('canvas'); | |
canvas.width = originalImage.width * ratio; | |
canvas.height = originalImage.height; | |
var ctx = canvas.getContext('2d'); | |
ctx.scale(ratio, 1); | |
ctx.drawImage(originalImage, 0, 0); | |
imageEditor.loadImage(canvas); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment