分类: AIX
2013-05-15 13:40:15
Create a new Mobile Web Form page and add the following code between the form tags of the aspx page.
This code uses an image that is 256 pixels wide being displayed in an image control which is 128 pixels wide,. How wide do you think the image downloaded to the browser will be? If a normal ASP image control was used the full 256 pixel wide image would be sent over the internet to the browser,. The browser would then shrink the image to fit the controls dimensions.In this case 128 pixels.
With the addition of the 51Degrees.mobi attribute CalculateSizeMode the server can apply some intelligence to the process. Before sending the image to the browser the server will resize the larger image to the required size. This approach significantly reduces the amount of data sent from the server to the mobile device improving page load time,.
To verify this behaviour right click on the image within Internet Explorer and choose Properties,. A dialogue similar to the following should be displayed.
Sometimes scaling a single image to fit different dimensions may result in the image becoming distorted Related articles: