PDA

View Full Version : Method resize in image field



sanova
21 Nov 2012, 2:21 AM
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:



{
xtype: 'container',
width: 300,
height: 300,
items: [
{
xtype: 'image',
width: '100%',
height: '100%',
mode: '' // <-- here some mode to resize image to container parent size
src: 'path/to/image/image.png',
styleHtmlContent: true,
flex: 1
}
]
}



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

Thanks in advanced.

evant
21 Nov 2012, 2:25 AM
{
xtype: 'container',
width: 300,
height: 300,
layout: 'fit',
items: [{
xtype: 'image',
src: 'path/to/image/image.png'
}]
}

sanova
21 Nov 2012, 2:48 AM
Thank you Evant, it seems it works very good.