FigureVerticalAnchor 枚举

定义

描述图形在垂直方向的引用点。Describes the point of reference of a figure in the vertical direction.

public enum class FigureVerticalAnchor
public enum FigureVerticalAnchor
type FigureVerticalAnchor = 
Public Enum FigureVerticalAnchor
继承
FigureVerticalAnchor

字段

ContentBottom 5

将图形锚定在页面内容区域的底部。Anchor the figure to the bottom of the page content area.

ContentCenter 4

将图形锚定在页面内容区域的中心。Anchor the figure to the center of the page content area.

ContentTop 3

将图形锚定在页面内容区域的顶部。Anchor the figure to the top of the page content area.

PageBottom 2

将图形锚定在页面区域的底部。Anchor the figure to the bottom of the page area.

PageCenter 1

将图形锚定在页面区域的中心。Anchor the figure to the center of the page area.

PageTop 0

将图形锚定在页面区域的顶部。Anchor the figure to the top of the page area.

ParagraphTop 6

将图形锚定在当前段落的顶部。Anchor the figure to the top of the current paragraph.

示例

下面的示例演示如何设置VerticalAnchor Figure元素的属性。The following example shows how to set the VerticalAnchor attribute of a Figure element.

<FlowDocument>
  <Paragraph>
    <Figure
      Name="myFigure"              
      Width="140" Height="50" 
      HorizontalAnchor="PageCenter"
      VerticalAnchor="PageCenter"
      HorizontalOffset="100" 
      VerticalOffset="20" 
      WrapDirection="Both"
      />
  </Paragraph>
</FlowDocument>

下面的示例演示如何以编程方式VerticalAnchor设置属性。The following example shows how to set the VerticalAnchor property programmatically.

Figure figx = new Figure();
figx.Name = "myFigure";
figx.Width = new FigureLength(140);
figx.Height = new FigureLength(50);
figx.HorizontalAnchor = FigureHorizontalAnchor.PageCenter;
figx.VerticalAnchor = FigureVerticalAnchor.PageCenter;
figx.HorizontalOffset = 100;
figx.VerticalOffset = 20;
figx.WrapDirection = WrapDirection.Both;

Paragraph parx = new Paragraph(figx);
FlowDocument flowDoc = new FlowDocument(parx);
Dim figx As New Figure()
With figx
    .Name = "myFigure"
    .Width = New FigureLength(140)
    .Height = New FigureLength(50)
    .HorizontalAnchor = FigureHorizontalAnchor.PageCenter
    .VerticalAnchor = FigureVerticalAnchor.PageCenter
    .HorizontalOffset = 100
    .VerticalOffset = 20
    .WrapDirection = WrapDirection.Both
End With

Dim parx As New Paragraph(figx)
Dim flowDoc As New FlowDocument(parx)

注解

术语 "内容" 与下面的成员有关, 是指页面减去页边距, 换言之, 内容是页面填充内的所有内容。The term content, as it pertains to the members below, refers to the page minus the page padding or in other words the content is everything inside of the page padding.

适用于