mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 07:27:45 +00:00
Base: Move all the HTML test content into /res/html/misc
This commit is contained in:
parent
4720635aab
commit
de12cf6821
58 changed files with 1 additions and 1 deletions
28
Base/res/html/misc/img-canvas.html
Normal file
28
Base/res/html/misc/img-canvas.html
Normal file
|
@ -0,0 +1,28 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>canvas drawImage() test</title>
|
||||
<style>
|
||||
canvas {
|
||||
border: 1px solid black;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
img = document.querySelector("img");
|
||||
|
||||
img.addEventListener("load", function() {
|
||||
var ctx = document.querySelector("canvas").getContext("2d");
|
||||
ctx.fillStyle = '#666';
|
||||
ctx.fillRect(0, 0, 400, 400);
|
||||
ctx.scale(2, 2);
|
||||
ctx.drawImage(img, 30, 30);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<canvas width=400 height=400></canvas>
|
||||
<img src="../../../res/icons/buggie.png">
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue