Storing an image deformation


#1

Hello,

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?


#2

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,
Gaëtan

[1] http://developer.microej.com/javadoc/microej_4.1/foundation/ej/microui/display/GraphicsContext.html
[2] http://developer.microej.com/javadoc/microej_4.1/foundation/ej/microui/display/Image.html


#3

Hi @gaetan.harel,

It works fine, thank you!