GWT background image -


I am using gwt to display a dynamic image inside of TD and the image coming from the image bandle , But it is showing the whole image, which creates during the GVT compilation, rather than showing a specific part of that big image inside that TD. I do not know what I'm missing ... The problem is that the image will be added and dynamically selected and I can not define each CSS when adding an image, if any of you about it This is my code that can help me.

My table cell is defined like UIB inder ....

   & Lt; / TR & gt;   

Function inside the presenter class:

  selected public color new color (image pattern image) {style pattern image style = pattern image. Get Element () GetStyle (); Style style = getColourPreviewSlot () GetStyle (); Style.setWidth (patternImage.getWidth (), Unit.PX); Style.setBackgroundImage (patternImageStyle.getBackgroundImage ()); Style.setLeft (-Pater ImageGateOrigin Left (), Unit.PX); Style.setTop (-Patiety ImageGateOnGiantTop (), Unit.PX); Style.setHeight (patternImage.getHeight (), Unit.PX); }   

When I debug my code, I get html for the pattern image object:

     

Best regards,

If you are using this picture a background sprite, you feel that you have to use CSS property to "move" your image to "back" in TD.

"left" and The "above" attribute is relative to the element that you set the style, its underlying background image is not.

Comments