Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8348055
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T07:34:27+00:00 2026-06-09T07:34:27+00:00

My question is really simple and shot. but hope I can have a clear

  • 0

My question is really simple and shot. but hope I can have a clear answer.
We can create GWT Image in many ways.

Image image = new Image ( (ImageResource)imageRes);

Image image = new Image ( (ImageResource)imageRes.getSafeUri() );

Image image = new Image ();
image.setUrl((ImageResource)imageRes.getSafeUri().asString() );

My question is: what are the difference among these 3 ways to create a new image using ImageResouce. Which one is best or faster for first-time loading?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T07:34:28+00:00Added an answer on June 9, 2026 at 7:34 am

    First, you should not use the last two.

    An ImageResource technically represents a region within a “sprited” image: it has a URL to the sprite and the coordinates of the region on that image. In many browsers, and for most images, the URL will actually be a data: URL and the region will represent the whole image. This can be controlled on a per-image basis using @ImageOptions(preventInlining=true) or globally with a set-property on your gwt.xml. In other words, your code shouldn’t rely on it, and should always treat an ImageResource as a region within a sprited image.
    FYI, the cases where a sprited image is actually used by default are for IE6/7 which does not support data: URLs, and for images that are too large to fit within a data: URL (all browsers).

    This is however exactly what you’re doing in the last two cases: use only the URL of the ImageResource, as if it weren’t (potentially) a sprited image.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Really simple question, but I can't seem to see the answer in the docs.
Probably a really simple question to answer but I can't for the life of
Really simple question but I can't find an answer. I know how to do
This seems like a really simple question, but I can't find the answer anywhere.
This is a simple question really (but I couldn't seem to find the answer
I feel like the answer to this question is really simple, but I really
This seems like a really simple question; but I can't see how it's actually
I hope this is a really simple question, but it's stumped me. Basically, I
This is maybe a really simple question, but I couldn't locate an answer: For
simple question really (can hazard a guess but just need to make sure), Just

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.