Scaling an Image in GWT
Posted
by Daniel
on Stack Overflow
See other posts from Stack Overflow
or by Daniel
Published on 2010-02-14T07:45:37Z
Indexed on
2010/05/08
10:18 UTC
Read the original article
Hit count: 316
Changing the size of an Image Widget in GWT changes the size of the image element, but does not rescale the image on the screen. Therefore, the following will not work:
Image image = new Image(myImageResource);
image.setHeight(newHeight);
image.setWidth(newWidth);
image.setPixelSize(newWidth, newHeight);
This is because GWT implements its Image widget by setting the background-image of the HTML <img... /> element as the image, using CSS.
How does one get the actual image to resize?
© Stack Overflow or respective owner