言語

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

長さを構成するデバイスに依存しないピクセル (1 インチあたり 96 ピクセル) の数。

次の例では、ユーザーがFigureをクリックすると、WidthFigureが減少します。 サンプルの 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>

WidthFigureを減らすコードを次に示します。

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をクリックすると、WidthFigureが減少します。 サンプルの 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>

WidthFigureを減らすコードを次に示します。

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

適用対象