-
21 Nov 2012 2:21 AM #1
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:
This only for the case i have a big image with big resolution and so to adapt it to container size.PHP Code:{
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
}
]
}
Thanks in advanced.
-
Best Answer Posted by evantCode:
{ xtype: 'container', width: 300, height: 300, layout: 'fit', items: [{ xtype: 'image', src: 'path/to/image/image.png' }] }
-
21 Nov 2012 2:25 AM #2Sencha - Ext JS Dev Team
- Join Date
- Apr 2007
- Location
- Sydney, Australia
- Posts
- 15,077
- Vote Rating
- 97
- Answers
- 169
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!
-
21 Nov 2012 2:48 AM #3
Thank you Evant, it seems it works very good.


Reply With Quote