共用方式為


Image 項目

表示影像。

使用方式

<Image
  Source = "xs:anyURI"
  MinDPI = "xs:positiveInteger"
  Symbol = "xs:string"
  Id = "xs:positiveInteger union xs:string">
  child elements
</Image>

屬性

屬性 類型 必要 說明
識別碼
xs:positiveInteger union xs:string
No
唯一的資源識別碼。

(xs:positiveInteger 和 xs:string) 的聯集
介於 2 到 59999、內含或0x2和0xea5f的整數值,以十六進位、包含。
最大長度為 10 個字元,包括選擇性的前置零。
MinDPI
xs:positiveInteger
No
(xs:positiveInteger)
最小值為 96 的任何數位序列。
如果省略 MinDPI,預設值為 96。
來源
xs:anyURI
No
(xs:anyURI)
代表 URI 的任何字元序列。 URI 值是功能區標記檔案的絕對或相對 (,) 類型 BMP 影像資源的路徑。
符號
xs:string
No
影像的資源符號。

(xs:string)
由字母或底線組成的字串,後面接著任何字母、數位或底線序列,最多 100 個字元。

子元素

元素 Description
Image.Source
最多可能發生一次

父元素

元素
Command.LargeHighContrastImages
Command.LargeImages
Command.SmallHighContrastImages
Command.SmallImages

備註

選擇性。

每個 Command.SmallImagesCommand.SmallHighContrastImagesCommand.LargeImages、Command.LargeImagesCommand.LargeHighContrastImages 元素可能會發生一或多次。

當設計來支援特定螢幕點的影像資源集合, (DPI) 設定透過一組 Image 元素提供給功能區架構時,架構會使用 Image 搭配符合目前螢幕 DPI 設定的 MinDPI 屬性值。

如果未使用符合目前螢幕 DPI 設定的MinDPI值來宣告Image元素,架構會挑選最接近MinDPI值的Image小於目前螢幕 DPI 設定,並將影像資源相應增加。 否則,如果沒有以小於目前螢幕 DPI 設定的MinDPI屬性值宣告Image元素,架構會挑選大於目前螢幕 DPI 設定的最接近MinDPI值,並縮小影像資源。

範例

下列程式碼範例示範透過一組 Image 元素宣告所需的標記,這是設計來支援四個特定螢幕 DPI 設定的影像資源集合。

<Command Name="cmdSizeAndColor" Symbol="IDR_CMD_SIZEANDCOLOR">
  <Command.LabelTitle>
    <String Id="250">Size and Color</String>
  </Command.LabelTitle>
  <Command.LargeImages>
    <Image Id="251" MinDPI="96">res/sizeAndColor_96.bmp</Image>
    <Image Id="252" MinDPI="120">res/sizeAndColor_120.bmp</Image>
    <Image Id="253" MinDPI="144">res/sizeAndColor_144.bmp</Image>
    <Image Id="254" MinDPI="192">res/sizeAndColor_192.bmp</Image>
  </Command.LargeImages>
</Command>

項目資訊

  • 最低支援系統:Windows 7
  • 可以是空的:否

另請參閱

指定功能區映射資源