Search
How can I size image content for so many different mobile screen sizes?

Source Image

Standard ASP.NET image controls contain an attribute called ImageUrl enabling a single image source to be provided.

51Degrees.mobi allows multiple image sources to be provided to all image controls using a collection. The following code example shows how multiple image sources are provided.

ASP.NET

<mob:Image runat="server" ID="ImageFlower" ImageUrl="~/Images/PurpleFlower.jpg" CalculateSizeMode="ClientWidth">
    <mob:AltImage ImageUrl="~/Images/PurpleFlower_480.jpg" />
    <mob:AltImage ImageUrl="~/Images/PurpleFlower_360.jpg" />
    <mob:AltImage ImageUrl="~/Images/PurpleFlower_200.jpg" />
    <mob:AltImage ImageUrl="~/Images/PurpleFlower_120.jpg" />
</mob:Image>


At runtime the server will work with the browser to determine the size of image needed. The closest match is then chosen from the collection provided. It is then shrunk to meet the precise dimensions required.

This approach enables designers to retain complete control, whilst optimising their design for performance. Read the Images chapter from the Developers guide to find out more about 51Degrees.mobi image controls and additional features.

Nokia C7

View Demonstration
Buy a License
Menu:
width:
  
Background:
Text Size:
Menu 01 Menu 02 Menu 03 Menu 04 Background 01 Background 02 Background 03 Background 04 Background 05 Background 06 Background 07 Background 08 Background 09 Background 10
Open Top Panel
Close Top Panel