FigureLength コンストラクター

定義

FigureLengthの新しいインスタンスを初期化します。

オーバーロード

FigureLength(Double)

長さを示すピクセル数を指定して、FigureLength クラスの新しいインスタンスを初期化します。

FigureLength(Double, FigureUnitType)

指定された FigureLengthValue を使用して、FigureUnitType クラスの新しいインスタンスを初期化します。

FigureLength(Double)

長さを示すピクセル数を指定して、FigureLength クラスの新しいインスタンスを初期化します。

public:
 FigureLength(double pixels);
public FigureLength (double pixels);
new System.Windows.FigureLength : double -> System.Windows.FigureLength
Public Sub New (pixels As Double)

パラメーター

pixels
Double

長さを構成するデバイス非依存ピクセルの数 (96 ピクセル/インチ)。

次の例では、ユーザーがクリック 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>

以下は、以下のコードを減 Width らすのに使用されます Figure.

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);
            }
        }
    }
}

適用対象

FigureLength(Double, FigureUnitType)

指定された FigureLengthValue を使用して、FigureUnitType クラスの新しいインスタンスを初期化します。

public:
 FigureLength(double value, System::Windows::FigureUnitType type);
public FigureLength (double value, System.Windows.FigureUnitType type);
new System.Windows.FigureLength : double * System.Windows.FigureUnitType -> System.Windows.FigureLength
Public Sub New (value As Double, type As FigureUnitType)

パラメーター

value
Double

Value クラスの FigureLength

type
FigureUnitType

Value クラスの FigureUnitType

次の例では、ユーザーがクリック 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>

以下は、以下のコードを減 Width らすのに使用されます Figure.

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);
            }
        }
    }
}

適用対象