移动.NET图像
移动.NET在不同设备类型上显示不同图像的类型。
Image控件
不同的移动设备显示的兼容性不同。
Image控件允许开发者为不同的设备类型指定图像的不同类型。
Image类型
有些移动设备显示GIF图像,有些显示BMP或者WBM图像,Image控件允许你为每个适合的图像类型指定不同的图像。
这个移动页面显示一个图像:
| <%@ Page Inherits= "System.Web.UI.MobileControls.MobilePage"%> <%@ Register TagPrefix="Mobile" Namespace="System.Web.UI.MobileControls" Assembly="System.Web.Mobile" %> <Mobile:Form runat="server"> <Mobile:Image runat="server"> <DeviceSpecific> <Choice ImageURL="image.gif" /> <Choice ImageURL="image.bmp" /> <Choice ImageURL="image.wbmp" /> </DeviceSpecific> </Mobile:Image> </Mobile:Form> |
当这个页面显示在Pocket PC上的时候,将显示成GIF图像。在手机上将根据收集的特性显示成WBMP或者BMP图像。
移动.NET Utility
Utility控件通过很少的代码支持复杂的用户界面。
Adrotator 控件
这个移动页面显示不同的广告:
| <%@ Page Inherits= "System.Web.UI.MobileControls.MobilePage"%> <%@ Register TagPrefix="Mobile" Namespace="System.Web.UI.MobileControls" Assembly="System.Web.Mobile" %> <Mobile:Form runat="server"> <Mobile:AdRotator runat="server" AdvertisementFile="advertisements.xml"> </Mobile:AdRotator> </Mobile:Form> |
这个是广告(ad)文件叫做“advertisements.xml”:
| <?xml version="1.0" ?> <Advertisements> <Ad> <ImageUrl>image1.gif</ImageUrl> <BmpImageUrl>image1.bmp</BmpImageUrl> <WBmpImageUrl>image1.wbmp</WBmpImageUrl> <NavigateUrl>http://www.1.com</NavigateUrl> <AlternateText>Visit 1</AlternateText> </Ad> <Ad> <ImageUrl>image2.gif</ImageUrl> <BmpImageUrl>image2.bmp</BmpImageUrl> <WBmpImageUrl>image2.wbmp</WBmpImageUrl> <NavigateUrl>http://www.2.com</NavigateUrl> <AlternateText>Visit 2</AlternateText> </Ad> <Ad> <ImageUrl>image3.gif</ImageUrl> <BmpImageUrl>image3.bmp</BmpImageUrl> <WBmpImageUrl>image3.wbmp</WBmpImageUrl> <NavigateUrl>http://www.3.com</NavigateUrl> <AlternateText>Visit 3</AlternateText> </Ad> </Advertisements> |
日历控件
这个也动页面显示一个日历:
| <%@ Page Inherits= "System.Web.UI.MobileControls.MobilePage"%> <%@ Register TagPrefix="Mobile" Namespace="System.Web.UI.MobileControls" Assembly="System.Web.Mobile" %> <script runat="server"> Sub CalChanged(sender as Object,e as EventArgs) lab1.Text="You selected " & c1.SelectedDate ActiveForm=f2 End Sub </script> <Mobile:Form id="f1" runat="server"> <Mobile:Calendar id="c1" OnSelectionChanged="CalChanged" runat="server" /> </Mobile:Form> <Mobile:Form id="f2" runat="server"> <Mobile:Label id="lab1" runat="server" /> </Mobile:Form> |
这个例子里日历显示在第一个表单里,当用户从日历里面选择数据时,选择的日期显示在新的页面里。
PhoneCall控件
当用户选择文本这个移动页面显示文本“Tove’s number”和电话号码(555)555-5555。
The PhoneCall Control
| <%@ Page Inherits= "System.Web.UI.MobileControls.MobilePage"%> <%@ Register TagPrefix="Mobile" Namespace="System.Web.UI.MobileControls" Assembly="System.Web.Mobile" %> <Mobile:Form runat="server"> <Mobile:PhoneCall runat="server" PhoneNumber="(555) 555-5555" Text="Tove's number" AlternateFormat="{0}" /> </Mobile:Form> |
这里的属性”AllternateFormat”是{0}。设置成这种显示将会显示为文本状。
如果你是用值{1}它将显示成”PhoneNumber”。
你也可以实用如下的构作AlternateFormat =”{0}is{1}”.这时候将会显示“Tove's number is (555) 555-5555”。
Utility 控件
| Name | Function |
| AdRotator | Displays advertisements |
| Calendar | Displays a calendar |
| PhoneCall | Calls a telephone number |
要了解更多的信息参考MSDN。本文:http://www.qqread.com/dotnet/i720996000.html
相关图文阅读
频道图文推荐
健 康 咨 询
时 尚 咨 询
相关专题
- .NET移动与嵌入式技术 (5950篇文章)
- .NET开发手册 (5652篇文章)
- 电信运营商专栏 (4024篇文章)
- Wlan组网----家庭专题 (4184篇文章)
- .NET基础介绍 (713篇文章)
- .NET应用研究 (492篇文章)
- .NET实用开发 (1678篇文章)
- vb.net入门——ToolBar 控件的使用 (267次浏览)
- vb.net入门——OpenFileDialog 组件的使用 (75次浏览)
- vb.net入门——FontDialog 组件的使用 (52次浏览)
- vb.net用Graphics画一个五角星 (46次浏览)
- vb.net入门——FolderBrowserDialog 组件的使 (45次浏览)
- vb.net绘制干扰点 (44次浏览)
- vb.net入门——ColorDialog 组件的使用 (41次浏览)
- vb.net巧用ToolTip控件获取鼠标坐标 (39次浏览)
- 用vb.net创建一个鼠标绘图程序 (39次浏览)
- vb.net入门——SaveFileDialog 组件的使用 (38次浏览)



