mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 12:19:54 +00:00
LibWeb: Implement HTML::ImageBitmap creation from HTML::ImageData
This commit is contained in:
parent
8404df55d8
commit
81ccb655b4
Notes:
github-actions[bot]
2025-06-30 16:08:53 +00:00
Author: https://github.com/ayeteadoe
Commit: 81ccb655b4
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4801
Reviewed-by: https://github.com/ADKaster ✅
Reviewed-by: https://github.com/gmta
7 changed files with 120 additions and 14 deletions
|
@ -0,0 +1,25 @@
|
|||
<!DOCTYPE html>
|
||||
<body>
|
||||
<script src="../include.js"></script>
|
||||
<script>
|
||||
let canvas = document.createElement("canvas");
|
||||
|
||||
canvas.width = 20;
|
||||
canvas.height = 20;
|
||||
|
||||
let ctx = canvas.getContext("2d");
|
||||
ctx.fillStyle = "rgb(42, 110, 96)";
|
||||
ctx.fillRect(0, 0, 10, 10);
|
||||
let imageData = ctx.getImageData(0, 0, 20, 20);
|
||||
|
||||
asyncTest(async done => {
|
||||
try {
|
||||
const bitmap = await createImageBitmap(imageData);
|
||||
println(`[Success]: ${bitmap}`);
|
||||
} catch (err) {
|
||||
println(`[ Error ]: ${err}`);
|
||||
}
|
||||
done();
|
||||
});
|
||||
</script>
|
||||
</body>
|
Loading…
Add table
Add a link
Reference in a new issue