FigureLength FigureLength FigureLength FigureLength Constructors

定義

オーバーロード

FigureLength(Double) FigureLength(Double) FigureLength(Double) FigureLength(Double)

長さを示すピクセル数を指定して、FigureLength クラスの新しいインスタンスを初期化します。Initializes a new instance of the FigureLength class with the specified number of pixels in length.

FigureLength(Double, FigureUnitType) FigureLength(Double, FigureUnitType) FigureLength(Double, FigureUnitType) FigureLength(Double, FigureUnitType)

指定された FigureLengthValue を使用して、FigureUnitType クラスの新しいインスタンスを初期化します。Initializes a new instance of the FigureLength class with the specified Value and FigureUnitType.

FigureLength(Double) FigureLength(Double) FigureLength(Double) FigureLength(Double)

長さを示すピクセル数を指定して、FigureLength クラスの新しいインスタンスを初期化します。Initializes a new instance of the FigureLength class with the specified number of pixels in length.

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

パラメーター

pixels
Double Double Double Double

長さを構成するデバイス非依存ピクセルの数 (96 ピクセル/インチ)。The number of device-independent pixels (96 pixels-per-inch) that make up the length.

次の例では、ユーザーがをクリックFigureすると、のFigureWidth減少します。In the following example, when the user clicks on the Figure, the Width of the Figure decreases. 次に、サンプルの XAML を示します。Below is the XAML for the sample.

<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のを減らすために使用するコードを次に示します。FigureBelow is the code used to decrease the Width of the 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) FigureLength(Double, FigureUnitType) FigureLength(Double, FigureUnitType) FigureLength(Double, FigureUnitType)

指定された FigureLengthValue を使用して、FigureUnitType クラスの新しいインスタンスを初期化します。Initializes a new instance of the FigureLength class with the specified Value and 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 Double Double Double

Value クラスの FigureLengthThe Value of the FigureLength class.

次の例では、ユーザーがをクリックFigureすると、のFigureWidth減少します。In the following example, when the user clicks on the Figure, the Width of the Figure decreases. 次に、サンプルの XAML を示します。Below is the XAML for the sample.

<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のを減らすために使用するコードを次に示します。FigureBelow is the code used to decrease the Width of the 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);
            }
        }
    }
}

適用対象