Toggle navigation
☰
HTML
CSS
Scripting
Database
<!DOCTYPE html> <html> <body> <canvas id="imageCanvas" width="300" height="225" style="border:1px solid #d3d3d3;"></canvas> <script> var canvas = document.getElementById("imageCanvas"); var ctx = canvas.getContext("2d"); // Create an image object var img = new Image(); // Set the source img.src = "/pix/byron_bay_300x225.jpg"; // Draw the image once it has loaded img.onload = function() { // Simple draw ctx.drawImage(img, 0, 0); // Scaled draw (smaller version in top right) ctx.drawImage(img, 200, 10, 80, 60); }; </script> </body> </html>