ASP.NET Mobile Image Control[转]

Definition and Usage
定义和用法

The Image control is used to display an image on a mobile device.
图像控件的作用是:在一个移动设备上显示一个图像。

Note: Different wireless devices may support different image formats! For example, HTML-capable browsers support GIF files and WML-capable browsers support WBMP files.
注意:不同的无线设备可能支持不同的图像格式。举个例子来说,支持HTML的浏览器支持GIF文件,支持WML的浏览器支持WBMP文件。

You can specify multiple image files in the Image control and the Image control itself will choose the correct image format based on the target mobile device.
你可以在图像控件中指定多个图像文件;图像控件本身将根据指定的移动设备选择真确的图像格式。


Properties
属性

Property
属性
Value
Description
描述
AlternateText text Optional. Specifies an alternate text for the image
可选参数。指定图像所对应的替换文本
Alignment left
center
right
Optional. How to align the image
可选参数。指定图像的排列方式
BackColor rgb(x,x,x)
#xxxxxx
colorname
Optional. A background color for the image
可选参数。指定图像的背景色
id unique_name Optional. A unique id for the control
可选参数。为控件指定一个独立的id
ImageUrl url Optional. The URL of the image
可选参数。指定图像的URL
NavigateUrl targetUrl Optional. Sets or returns the target URL of the link
可选参数。设置或返回目标URL链接
runat "server" Required. Specifies that the control is a server control
必要参数。指定某个控件为一个服务器控件
SoftkeyLabel label Optional. Sets or returns the text displayed for a softkey when the NavigateUrl property defined
可选参数。当NavigateURI属性被定义时,设置或返回一个软键[softkey]的文本显示
StyleReference name_of_style_element Optional. Specifies a reference to a style to be applied to the control
可选参数。指定一个应用于控件的样式参数

Example 1
案例1

The following example will display an image in an .aspx file:
下面这个案例将显示 .aspx文件中的一张图像:

<%@ 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>

When this page is displayed on pocket PC, a GIF image will be displayed. On a cell phone a WBMP image or a BMP image will be displayed, according to the characteristics of the cell phone.
当在袖珍PC中显示这个页面时,将会显示一张GIF图像。在手机上,它将会显示一张WBMP图像或一张BMP图像,这主要根据手机的具体特点的不同而不同。

posted on 2009-03-17 17:03  黄裳  阅读(260)  评论(0)    收藏  举报

导航