tag:blogger.com,1999:blog-5682413770770674096.post2424686137953908268..comments2024-01-07T10:01:04.001-05:00Comments on Michael Angstadt's Blog: GWT Image BundlesMichael Angstadthttp://www.blogger.com/profile/04809821580827426849noreply@blogger.comBlogger12125tag:blogger.com,1999:blog-5682413770770674096.post-58903050894175051002015-06-15T19:48:18.913-04:002015-06-15T19:48:18.913-04:00A bit late but I'll post this if people find i...A bit late but I'll post this if people find it useful;<br /><br /><br /><br />In your gwt.xml will force gwt to use image strips. VERY useful if your using them for animations, as DataURLs are too slow for that. <br /><br />You might also need this;<br />"-Dgwt.imageResource.maxBundleSize=1000" in GWT compile options, VM arguments. This will override the normal size limit <br /><br />Thomas Wrobelhttp://lostagain.nlnoreply@blogger.comtag:blogger.com,1999:blog-5682413770770674096.post-52865977010484677812014-06-13T08:48:05.658-04:002014-06-13T08:48:05.658-04:00Ok Micheal Thanks...Ok Micheal Thanks...Anonymoushttps://www.blogger.com/profile/05695302054022388448noreply@blogger.comtag:blogger.com,1999:blog-5682413770770674096.post-46920924470860984862014-01-23T06:36:40.845-05:002014-01-23T06:36:40.845-05:00This comment has been removed by the author.Anonymoushttps://www.blogger.com/profile/02973077001078953722noreply@blogger.comtag:blogger.com,1999:blog-5682413770770674096.post-76883666015517829722014-01-23T06:35:53.069-05:002014-01-23T06:35:53.069-05:00Still nothin about dynamically reading images As r...Still nothin about dynamically reading images As requested L5? it's wiered it's possible with i18n strings and not with imagesAnonymoushttps://www.blogger.com/profile/02973077001078953722noreply@blogger.comtag:blogger.com,1999:blog-5682413770770674096.post-25850220731525308942012-08-28T22:01:03.271-04:002012-08-28T22:01:03.271-04:00Ok, let me know!Ok, let me know!Michael Angstadthttps://www.blogger.com/profile/04809821580827426849noreply@blogger.comtag:blogger.com,1999:blog-5682413770770674096.post-2303443559281741032012-08-28T14:51:14.485-04:002012-08-28T14:51:14.485-04:00Thanks, Michael. For now, where I know the image w...Thanks, Michael. For now, where I know the image will be one of a list (enum), I'm using a switch and hard-coding. But when we need more than can be handled this way, I'll try what you say. The image is needed for clickable buttons (Sencha's lib GXT) which apparently require actual ImageResource objects/classes? (I'm very new to this) -- if I can figure out how to implement your idea, I'll post back sometime.L5https://www.blogger.com/profile/14482398827037825998noreply@blogger.comtag:blogger.com,1999:blog-5682413770770674096.post-40454248907721480262012-08-23T14:03:08.509-04:002012-08-23T14:03:08.509-04:00Hi L5,
Have you tried creating a new instance of ...Hi L5,<br /><br />Have you tried creating a new instance of the "Image" class using the "Image(String)" constructor? This constructor allows the developer to pass in a URL to the image. In order to figure out what the URL of an image on the classpath looks like, you could create a "ClientBundle" class as I describe in my blog post, and then call the "ImageResource.getSafeUri()" method.Michael Angstadthttps://www.blogger.com/profile/04809821580827426849noreply@blogger.comtag:blogger.com,1999:blog-5682413770770674096.post-72994045997737781272012-08-22T12:04:55.767-04:002012-08-22T12:04:55.767-04:00I can't find anyone addressing how to use an I...I can't find anyone addressing how to use an ImageResource dynamically. That is, defined properly using ClientBundle but then accessed through other classes using a method like getIcon(String nameOfIcon) where you don't know which icon you'll need until you are building your object that needs it, and want to call for it by name. (I know it's been a while since this blog post, but I'm flailing madly, here)L5https://www.blogger.com/profile/14482398827037825998noreply@blogger.comtag:blogger.com,1999:blog-5682413770770674096.post-86619419647879362342012-02-21T21:13:40.505-05:002012-02-21T21:13:40.505-05:00Thanks for the tip! Do you know if this brings an...Thanks for the tip! Do you know if this brings any performance gain?Michael Angstadthttps://www.blogger.com/profile/04809821580827426849noreply@blogger.comtag:blogger.com,1999:blog-5682413770770674096.post-70539744578506046322012-02-19T09:32:32.398-05:002012-02-19T09:32:32.398-05:00If you like, you can force GWT to use sprites inst...If you like, you can force GWT to use sprites instead of data URIs in all browsers by setting a property in your module file:<br /><br /><set-property name='ClientBundle.enableInlining' value='false' />Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5682413770770674096.post-27933910309387879642012-01-12T19:02:01.290-05:002012-01-12T19:02:01.290-05:00Looks like you're right. I tried deploying th...Looks like you're right. I tried deploying the app to Tomcat and running it there to test to see if maybe it only used data URIs in dev mode, but it uses data URIs when deployed too. Thanks for the correction.Michael Angstadthttps://www.blogger.com/profile/04809821580827426849noreply@blogger.comtag:blogger.com,1999:blog-5682413770770674096.post-55771018465705028052012-01-12T13:46:49.726-05:002012-01-12T13:46:49.726-05:00GWT does create an image sprite, but it uses it on...GWT does create an image sprite, but it uses it only for IE7 and possibly IE6. Chrome & FF are treated with data URI.Boris Jockovhttps://www.blogger.com/profile/12195257853404325396noreply@blogger.com