FigureLength 結構
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
描述 Figure 的高度或寬度。
public value class FigureLength : IEquatable<System::Windows::FigureLength>
[System.ComponentModel.TypeConverter(typeof(System.Windows.FigureLengthConverter))]
public struct FigureLength : IEquatable<System.Windows.FigureLength>
[<System.ComponentModel.TypeConverter(typeof(System.Windows.FigureLengthConverter))>]
type FigureLength = struct
Public Structure FigureLength
Implements IEquatable(Of FigureLength)
- 繼承
- 屬性
- 實作
在下列範例中,當使用者按一下 Figure 時, Width 的 Figure 會減少。 以下是範例的 XAML。
<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="SDKSample.FigureLengthExample" >
<FlowDocumentReader>
<FlowDocument >
<Paragraph>
Raw text inside the paragraph
<Figure Name="myFigure" Width="300">
<Paragraph FontStyle="Italic" MouseDown="OnMouseDownDecreaseWidth" >
Text inside of paragraph that is inside Figure...
</Paragraph>
</Figure>
</Paragraph>
</FlowDocument>
</FlowDocumentReader>
</Page>
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
namespace SDKSample
{
public partial class FigureLengthExample : Page
{
void OnMouseDownDecreaseWidth(object sender, MouseButtonEventArgs args)
{
FigureLength myFigureLength = myFigure.Width;
double widthValue = myFigureLength.Value;
if (widthValue > 0)
{
myFigure.Width = new FigureLength((widthValue - 10), FigureUnitType.Pixel);
}
}
}
}
<object property="length"/>
-或-
<object property="qualifiedDouble"/>
length (長度)
以圖元為單位的 Figure 寬度或高度,以 Double 值描述。 或者,這個值可以使用單位宣告字串限定, (px
、 in
、、、 cm
) pt
請參閱下方 的 qualifiedDouble 。
qualifiedDouble
上述的 雙精度 浮點數,後面接著下列其中一個單位宣告字串: px
、、 in
、 cm
、 pt
。
px
(預設) 是裝置獨立單位 (每單位 1/96 英吋)
in
為英吋;1in==96px
cm
為公分;1cm== (96/2.54) px
pt
為點;1pt== (96/72) px
Figure |
使用指定像素的長度,初始化 FigureLength 類別的新執行個體。 |
Figure |
使用指定的 FigureLength 和 Value,初始化 FigureUnitType 類別的新執行個體。 |
Figure |
取得 Value 的單位類型。 |
Is |
取得值,這個值決定此 FigureLength 是否為絕對值 (以像素為單位)。 |
Is |
取得值,這個值決定此 FigureLength 是否為自動 (未指定)。 |
Is |
取得值,這個值決定此 FigureLength 是否擁有 FigureUnitType 的 Column 屬性值。 |
Is |
取得值,這個值決定此 FigureLength 是否擁有 FigureUnitType 的 Content 屬性值。 |
Is |
取得值,這個值決定此 FigureLength 是否擁有 FigureUnitType 的 Page 屬性值。 |
Value |
取得這個 FigureLength 的值。 |
Equals(Figure |
比較兩個 FigureLength 結構是否相等。 |
Equals(Object) |
判斷所指定 Object 是否為 FigureLength,且是否與這個 FigureLength 相同。 |
Get |
傳回這個 FigureLength 的雜湊程式碼。 |
To |
建立這個 String 的 FigureLength 表示。 |
Equality(Figure |
比較兩個 FigureLength 結構是否相等。 |
Inequality(Figure |
比較兩個 FigureLength 結構是否相等。 |
產品 | 版本 |
---|---|
.NET Framework | 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8 |
Windows Desktop | 3.0, 3.1, 5, 6, 7 |