Results 1 to 3 of 3

Thread: Method resize in image field

  1. #1
    Sencha User
    Join Date
    Feb 2012
    Posts
    37
    Vote Rating
    0
      0  

    Default 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 User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    18,940
    Answers
    716
    Vote Rating
    917
      1  

    Default

    Code:
    {
        xtype: 'container',
        width: 300,
        height: 300,
        layout: 'fit',
        items: [{
            xtype: 'image',
            src: 'path/to/image/image.png'
        }]
    }
    Twitter - @evantrimboli
    Former framework engineer, available for consulting.
    As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.

  4. #3
    Sencha User
    Join Date
    Feb 2012
    Posts
    37
    Vote Rating
    0
      0  

    Default

    Thank you Evant, it seems it works very good.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •