-
Hello, I'm currently trying to build a sticker app where you can add stickers dynamically as well as interact with them, this includes translate, scale and rotate transformations. I wonder how can I achieve this programatically, I'm looking to set the transformation as well as to change the origin of such transformations; I do not see any way to set up a group or something with the imperative API, currently this is all I have: const offscreen = Skia.Surface.MakeOffscreen();
const canvas = offscreen?.getCanvas();
if(canvas) {
canvas.drawImage(image, 0, 0, Skia.Paint());
} |
Beta Was this translation helpful? Give feedback.
Answered by
Glazzes
Nov 3, 2024
Replies: 1 comment
-
Looking around in stackoverflow I found a solution based on the HTML canvas, it looks like this // Before drawing your element, apply the transformations to the canvas
canvas.rotate(90, 200, 200) // Second and third parameter represent the origin of the transformation
canvas.drawImage(image, 0, 0, Skia.Paint());
canvas.restore(); // Restore transformations to their initial state |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Glazzes
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Looking around in stackoverflow I found a solution based on the HTML canvas, it looks like this