Announcement

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

    Stretch image with middle image

    I am trying to create a StretchImg with the following images:

    1) A start image for the left edge.
    2) A "stretch" image.
    3) A fixed-width middle image
    4) The "stretch" image again.
    5) An end image for the right edge.

    Now, images (2) and (5) are identical and should split the stretch space between them; i.e., I want the middle image to show up exactly in the middle of the button. So, I did this:

    Code:
    items:[
      {name:"start",height:"height",width:"capSize"},
      {name:"stretch",height:"height",width:"*"},
      {name:"middle",height:"height",width:"middleImgWidth"},
      {name:"stretch",height:"height",width:"*"},
      {name:"end",height:"height",width:"capSize"}
    ]
    In IE this works great; the two stretch images take up half the stretch space each and the middle image shows up exactly in the center.

    However, in Firefox the first stretch image gets squeezed into zero space and all the stretch space is given to the second stretch image. That is, I get the middle image showing up next to the start image, all the way on the left. Is there any way to prevent this behavior?

    #2
    Getting a "works for me" result in SmartClient 6.0, FF 2.0.0.13, with this code:

    Code:
    isc.StretchImg.create({
        ID:'foo',
        width:500,
        height:50,
        vertical:false,
        src:"[SKIN]/button/button.png",
        autoDraw:true,
        capSize:10,
        middleImgWidth:10,
        items:[
          {name:"start",height:"height",width:"capSize"},
          {name:"stretch",height:"height",width:"*"},
          {name:"middle",height:"height",width:"middleImgWidth"},
          {name:"stretch",height:"height",width:"*"},
          {name:"end",height:"height",width:"capSize"}
        ]
    });
    What's your setup?

    Comment


      #3
      That's the same as my setup. I'm doing a bit of further testing to see if I can get it to work in a different context. The only unique thing about the way I'm using it, and maybe this makes a difference, is that it's actually a StretchImgButton being used as a Tab.

      Comment


        #4
        Well...I got it working but I'm not sure how. The only thing I changed that might be important is to make sure that all "middle" images are the same width (originally, the middle image for selected state was quite a bit wider than the one for unselected state). Anyway, it all looks good now. If I find out what the problem was I'll re-post here.

        Comment


          #5
          I did discover one possible caught while futzing around. In Firefox with strict DOCTYPE only, an image with a bad URL (404) does not take up space (even though SmartClient assigns it a size). That might explain your issue.

          Comment


            #6
            stretch there different images can lead to that result, i was having the same problem. i am a fan of c# programming languages. anyone can give me scripts about how to stretch images? help appreciated.

            Comment


              #7
              Originally posted by agimage View Post
              stretch there different images can lead to that result, i was having the same problem. i am a fan of c# programming languages. anyone can give me scripts about how to stretch images? help appreciated.
              do you still need codes to stretch image, please let me know by email. i am interested in stretch image in Firefox with an image application. i may need some help on this one.

              Comment

              Working...
              X