$sourceCanvas = document.createElement("canvas");
$sourceCanvas.width = 300;
$sourceCanvas.height = 300;
$sourceContext = $sourceCanvas.getContext("2d");
$destCanvas = document.createElement("canvas");
$destCanvas.width = 1000;
$destCanvas.height = 1000;
$destContext = $destCanvas.getContext("2d");
$destContext.drawImage($sourceCanvas, 0, 0, 300, 300, 0, 0, 900, 900);