Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is HTML canvas getImageData() Method affected by translate() Method?

Tags:

html

In HTML5 Canvas, after calling translate(), does getImageData() return transformed image or not?

like image 460
Colin Wang Avatar asked Mar 03 '26 06:03

Colin Wang


1 Answers

It is not affected by the translate() method. See the specification for details.

From the specification...

"The current path, transformation matrix, shadow attributes, global alpha, the clipping region, and global composition operator must not affect the getImageData() and putImageData() methods."

As previously advised, as per this question.

like image 56
ManoDestra Avatar answered Mar 04 '26 23:03

ManoDestra