Figure.VerticalOffset 属性

定义

获取或设置一个值,该值指示 Figure 沿垂直方向从其基线偏移的距离。

public:
 property double VerticalOffset { double get(); void set(double value); };
[System.ComponentModel.TypeConverter(typeof(System.Windows.LengthConverter))]
public double VerticalOffset { get; set; }
[<System.ComponentModel.TypeConverter(typeof(System.Windows.LengthConverter))>]
member this.VerticalOffset : double with get, set
Public Property VerticalOffset As Double

属性值

Figure 沿垂直方向从其基线偏移的距离(以与设备无关的像素为单位)。

默认值为 0.0

属性

示例

以下示例演示如何设置 VerticalOffset 元素的 Figure 属性。

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

以下示例演示如何以编程方式设置 VerticalOffset 属性。

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)

注解

XAML 属性用法

<object VerticalOffset="double"/>  
- or -  
<object VerticalOffset="qualifiedDouble"/>  

XAML 值

double
Double

值等于或大于 0.0 但小于 PositiveInfinity的字符串表示形式Double。 非限定值以与设备无关的像素度量。 字符串不需要显式包含小数点。

qualifiedDouble
如上所述的双精度值,除) 后跟下列单位说明符之一外Auto, (:px、、incmpt、 。

px (默认) 为与设备无关的单位, (单位) 1/96 英寸

in 为英寸;1in==96px

cm 为厘米;1cm== (96/2.54) px

pt 是点;1pt== (96/72) px

依赖项属性信息

标识符字段 VerticalOffsetProperty
元数据属性设置为 true AffectsParentMeasure

适用于