Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Original size of PNG images

    Hi,

    I'm trying to use PNG images in my application (nothing fancy, plain SmartGWT Img objects), and I want them displayed in their original sizes.

    The Img objects are created as follows:
    Code:
          Img img = new Img("x.png");
          img.setImageType(ImageStyle.NORMAL);
          img.setAutoWidth();
          img.setAutoHeight();
    At runtime, the images are all displayed exactly 16x16 pixels big (instead of their original size) in Internet Explorer 7 and vanish completely in Firefox 3.

    The funny thing is: If I change the file ending (not the format, just the ending) to ".gif" or even ".rubbish", the image is shown in its original size as expected in both browsers.
    This problem is apparently not triggered by other image formats such as GIF or JPEG.

    I've found an issue that seems to be connected to this one, but setting overflow to visible and the Img's size to 1x1 pixels as suggested there did not do the trick.
    Anything new on this topic? Anything I can do as a workaround besides renaming all my images?

    I'm using SmartGWT 1.3 - I was not able to determine which SmartClient version this implies, I fear it might be outdated.
    Last edited by futlib; 6 Nov 2009, 06:39.

    #2
    Use GWT's Image class to determine the size / dimensions of an image.

    Sanjiv

    Comment


      #3
      Thanks for the hint sjivan!

      I had to use GWT Image Loader to get the dimensions properly and adjust width/height manually whenever I use setMargin(), but I got it to work.

      Comment

      Working...
      X