Background Class

Document Background.When the object is serialized out as xml, its qualified name is v:background.

Inheritance Hierarchy

System.Object
  DocumentFormat.OpenXml.OpenXmlElement
    DocumentFormat.OpenXml.OpenXmlCompositeElement
      DocumentFormat.OpenXml.Vml.Background

Namespace:  DocumentFormat.OpenXml.Vml
Assembly:  DocumentFormat.OpenXml (in DocumentFormat.OpenXml.dll)

Syntax

声明
<ChildElementInfoAttribute(GetType(Fill))> _
Public Class Background _
    Inherits OpenXmlCompositeElement
用法
Dim instance As Background
[ChildElementInfoAttribute(typeof(Fill))]
public class Background : OpenXmlCompositeElement

Remarks

The following table lists the possible child types:

  • Fill <v:fill>

[ISO/IEC 29500-1 第 1 个版本]

14.1.2.2 background (Document Background)

This element describes the fill of the background of a page using vector graphics fills. Fills consist of simple colors, more advanced effects defined through the fill element (§14.1.2.5), or images.

[Example: The following shades the page background a pale red:

<v:background fillcolor="#c0504d">
</v:background>

This uses the fill element (§14.1.2.5) to create a gradient background fill:

<v:background>
 <v:fill type="gradient" color="#c0504d" color2="#f0504d" angle="45"/>
</v:background>

end example]

Parent Elements

background (Part 1, §17.2.1); object (Part 1, §17.3.3.19); pict (§9.2.2.2); pict (§9.5.1)

Child Elements

Subclause

fill (Shape Fill Properties)

§14.1.2.5

Attributes

Description

bwmode (Black-and-White Mode)

Namespace: urn:schemas-microsoft-com:office:office

Specifies how a shape renders for black-and-white output devices. When a shape is printed on a black-and-white printer or displayed in a black-and-white view in an application, several options are possible. Default is auto, which uses o:bwnormal for normal black-and-white rendering and o:bwpure for pure black-and-white rendering

[Example: This shape renders in grayscale in a black-and-white environment:

<v:shape … o:bwmode="grayscale" … >
</v:shape>

end example]

The possible values for this attribute are defined by the ST_BWMode simple type (§14.2.3.3).

bwnormal (Normal Black-and-White Mode)

Namespace: urn:schemas-microsoft-com:office:office

Specifies the black-and-white mode for normal black-and-white output devices. Default is auto.

[Example: This shape renders in a pale grayscale in a normal black-and-white environment:

<v:shape … 
  o:bwmode="lightgrayscale" … >
</v:shape>

end example]

The possible values for this attribute are defined by the ST_BWMode simple type (§14.2.3.3).

bwpure (Pure Black-and-White Mode)

Namespace: urn:schemas-microsoft-com:office:office

Specifies the black-and-white mode for pure black-and-white output devices. Default is auto.

[Example: This shape renders in high contrast when in a pure black-and-white environment:

<v:shape … o:bwmode="highcontrast" … >
</v:shape>

end example]

The possible values for this attribute are defined by the ST_BWMode simple type (§14.2.3.3).

fillcolor (Fill Color)

Specifies the color to use for the fill. Default is white. If the fill element (§14.1.2.5) is present, its color attribute takes precedence. Colors are typically specified as either a named color, such as red, or six hexadecimal digits representing the red, green and blue values of the color, such as #00FF30. Full details are specified in the simple type description.

[Example: This shape is red if its fill is visible:

<v:shape … fillcolor="red" … >
</v:shape>

This is equivalent to:

<v:shape … fillcolor="#ff0000" … >
</v:shape>

end example]

The possible values for this attribute are defined by the ST_ColorType simple type (§15.1.2.3).

filled (Shape Fill Toggle)

Specifies whether the closed path is filled. Default is true. This attribute is overridden by the fill on attribute.

[Example:

<v:shape … filled="f" 
  fillcolor="red" …>
</v:shape>
DocumentFormat.OpenXml.Vml.Background-image001

end example]

The possible values for this attribute are defined by the ST_TrueFalse simple type (§15.1.2.5).

id (Unique Identifier)

Specifies a unique identifier that can be used to reference a VML object.

Default is no value.

[Example:

<v:shape … id="myShape" … >
</v:shape>

end example]

The possible values for this attribute are defined by the W3C XML Schema string datatype.

targetscreensize (Target Screen Size)

Namespace: urn:schemas-microsoft-com:office:office

Specifies the target resolution used for WordprocessingML documents with a gradient or picture filled background. Default is no value. Allowed values are:

  • 544,376

  • 640,480

  • 720,512

  • 800,600

  • 1024,768

  • 1152,862

The possible values for this attribute are defined by the ST_ScreenSize simple type (§14.2.3.23).

[Note: The W3C XML Schema definition of this element's content model (CT_Background) is located in §A.6.1. end note]

© ISO/IEC29500: 2008. 以上摘要已经由 Microsoft(和/或其代理公司)从英语翻译为简体中文,ISO 对此翻译不承担任何责任。

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

Background Members

DocumentFormat.OpenXml.Vml Namespace