Edvin, I think this kind of discussion is probably better suited to the dev mailing list ([email protected]). This reply is being sent to both user and dev lists. I will write a proper reply to the dev list in a moment.
For anyone wishing to follow this thread, the info for signing up to all the mailing lists can be found here. http://pivot.apache.org/lists.html Chris On 13 July 2011 21:15, SYSE | Edvin <[email protected]> wrote: > More and more often I come across existing web-graphics that needs to be > reused in desktop-applications. Webdesigners are gradually shifting towards > creating a sprite containing multiple images and using css to choose which > image to show. > > I would like to propose a small change to ImageView to support this > behavior, so that one can easier reuse existing web-graphics in > desktop-applications. Provided is a patch that shows what I mean. > > Here is an example of it's usage. Take a look at the following picture: > > http://askjems.no/files/gfx/viewmodes_sprite.png > > Showing the first "icon" in this image can be done by restricting the > maximum height to the height of each "icon": > > int iconHeight = 27; > imageView.setPreferredHeight(iconHeight); > > My patch will allow you to do this to show the second "icon": > > imageView.getStyles().put("offsetY", iconHeight); > > Third icon: > > imageView.getStyles().put("offsetY", iconHeight * 2); > > offsetX is also supported, for multi column sprites. Does that make > sense/look valuable? > > -- Edvin >
