1. #1
    Sencha User
    Join Date
    Feb 2012
    Posts
    37
    Vote Rating
    0
    sanova is on a distinguished road

      0  

    Default Answered: Method resize in image field

    Answered: Method resize in image field


    Hi,
    i'm using extjs 4.1.
    Is there some option to make resize of an image into field (xtype: image) inside a container having fixed size like this:

    PHP Code:
    {
    xtype'container',
    width300,
    height300,
    items: [
       {
           
    xtype'image',
           
    width'100%',
           
    height'100%',
           
    mode'' //  <-- here some mode to resize image to container parent size
           
    src'path/to/image/image.png',
           
    styleHtmlContenttrue,
           
    flex1
       
    }
    ]

    This only for the case i have a big image with big resolution and so to adapt it to container size.

    Thanks in advanced.

  2. Code:
    {
        xtype: 'container',
        width: 300,
        height: 300,
        layout: 'fit',
        items: [{
            xtype: 'image',
            src: 'path/to/image/image.png'
        }]
    }

  3. #2
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    17,049
    Vote Rating
    657
    Answers
    471
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      1  

    Default


    Code:
    {
        xtype: 'container',
        width: 300,
        height: 300,
        layout: 'fit',
        items: [{
            xtype: 'image',
            src: 'path/to/image/image.png'
        }]
    }
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  4. #3
    Sencha User
    Join Date
    Feb 2012
    Posts
    37
    Vote Rating
    0
    sanova is on a distinguished road

      0  

    Default


    Thank you Evant, it seems it works very good.

Thread Participants: 1