Storing an image deformation


From the microui documentation about images, I can see that it is possible to create a new Image from another image area.
I’ve also found how to transform (i.e. scale, rotate, deform) Images, but I can only manage to draw such transformations to the screen, and not store them into an Image.

Is there a way to create an image from another image deformation?

Hi @jadams,

You can indeed store the resulting deformation in a MicroUI Image by drawing in the GraphicsContext [1] of the Image [2].

Get back the GraphicsContext of the Image:

GraphicsContext gc = myDeformedImage.getGraphicsContext();

then draw your deformation into it:

imageDeformation.draw(gc, imageToBeDeformed, xys, x, y, anchor);

and myDeformedImage will contain the resulting deformation to be reused later.

Best Regards,


Hi @gaetan.harel,

It works fine, thank you!