Skip to content

How to apply transformations to an image with the imperative API? #2717

Closed Answered by Glazzes
Glazzes asked this question in Q&A
Discussion options

You must be logged in to vote

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

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Glazzes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant