WrapMode 列挙型

定義

テクスチャまたはグラデーションが塗りつぶし対象の領域よりも小さい場合の、並べ方を指定します。

public enum class WrapMode
public enum WrapMode
type WrapMode = 
Public Enum WrapMode
継承
WrapMode

フィールド

Clamp 4

グラデーションまたはテクスチャは並べて表示されません。

Tile 0

グラデーションまたはテクスチャを並べて表示します。

TileFlipX 1

テクスチャまたはグラデーションを水平方向に反転し、それを並べて表示します。

TileFlipXY 3

テクスチャまたはグラデーションを水平および垂直方向に反転し、それを並べて表示します。

TileFlipY 2

テクスチャまたはグラデーションを垂直方向に反転し、それを並べて表示します。

次のコード例では、 メソッドを使用して新しいビットマップを取得する方法を FromFile 示します。 また、 と 列挙もWrapModeTextureBrushします。 この例は、Windows フォームで使用するように設計されています。 という名前 Button2のボタンを含むフォームを作成します。 コードをフォームに貼り付け、 メソッドを Button2_Click ボタンの Click イベントに関連付けます。

private:
   void Button2_Click( System::Object^ /*sender*/, System::EventArgs^ /*e*/ )
   {
      try
      {
         Bitmap^ image1 = dynamic_cast<Bitmap^>(Image::FromFile( "C:\\Documents and Settings\\"
         "All Users\\Documents\\My Music\\music.bmp", true ));
         TextureBrush^ texture = gcnew TextureBrush( image1 );
         texture->WrapMode = System::Drawing::Drawing2D::WrapMode::Tile;
         Graphics^ formGraphics = this->CreateGraphics();
         formGraphics->FillEllipse( texture, RectangleF(90.0F,110.0F,100,100) );
         delete formGraphics;
      }
      catch ( System::IO::FileNotFoundException^ ) 
      {
         MessageBox::Show( "There was an error opening the bitmap."
         "Please check the path." );
      }
   }
private void Button2_Click(System.Object sender, System.EventArgs e)
{
    try
    {
        Bitmap image1 = (Bitmap) Image.FromFile(@"C:\Documents and Settings\" +
            @"All Users\Documents\My Music\music.bmp", true);

        TextureBrush texture = new TextureBrush(image1);
        texture.WrapMode = System.Drawing.Drawing2D.WrapMode.Tile;
        Graphics formGraphics = this.CreateGraphics();
        formGraphics.FillEllipse(texture, 
            new RectangleF(90.0F, 110.0F, 100, 100));
        formGraphics.Dispose();
    }
    catch(System.IO.FileNotFoundException)
    {
        MessageBox.Show("There was an error opening the bitmap." +
            "Please check the path.");
    }
}
Private Sub Button2_Click(ByVal sender As System.Object, _
    ByVal e As System.EventArgs) Handles Button2.Click
    Try
        Dim image1 As Bitmap = _
            CType(Image.FromFile("C:\Documents and Settings\" _
            & "All Users\Documents\My Music\music.bmp", True), Bitmap)

        Dim texture As New TextureBrush(image1)
        texture.WrapMode = Drawing2D.WrapMode.Tile
        Dim formGraphics As Graphics = Me.CreateGraphics()
        formGraphics.FillEllipse(texture, _
            New RectangleF(90.0F, 110.0F, 100, 100))
        formGraphics.Dispose()

    Catch ex As System.IO.FileNotFoundException
        MessageBox.Show("There was an error opening the bitmap." _
            & "Please check the path.")
    End Try

End Sub

注釈

ブラシは、この列挙体を使用して、図形の塗りつぶし方法を決定します。 列挙値がタイルイメージに及ぼす影響 WrapMode の例については、「 How to: Tile a Shape with an Image」を参照してください。

適用対象

こちらもご覧ください