Is there any GWT widget which allows me to:
- select a part of an image and then retrieve the selection area?
- resize an image and then give me the updated size?
The above should be reflected in the browser as well.
Is there any GWT widget which allows me to:
The above should be reflected in the browser as well.
As far as I know, GWT client-side code cannot directly modify images, but the Image widget can be set to display only a portion of an image. You can do this using the constructor Image(java.lang.String url, int left, int top, int width, int height)
, where width
and height
are the dimensions of the visible box and not the image itself.
However this does not allow you to resize and then crop. In order to do this you could first resize the image then put it in an absolute panel to crop it.
AbsolutePanel testPanel = new AbsolutePanel();
Image image = new Image("path/image.jpg");
image.setWidth("1000px");
testPanel.add(image,-100,-100);
testPanel.setPixelSize(300,300);
I apologize if this isn't exactly what you're looking for, but it's the best answer I have.