WrapMode 列挙体とは? わかりやすく解説

WrapMode 列挙体

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

名前空間: System.Drawing.Drawing2D
アセンブリ: System.Drawing (system.drawing.dll 内)
構文構文

メンバメンバ
解説解説
使用例使用例

FromFile メソッド使用して新しビットマップ取得するコード例次に示します。TextureBrush 列挙体および WrapMode 列挙体の使用例示します。この例は、Windows フォームでの使用意図してデザインされています。Button2 という名前のボタン格納するフォーム作成しますコードフォーム貼り付けButton2_Click メソッドボタンClick イベント関連付けます。

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
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:
   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(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.set_WrapMode(System.Drawing.Drawing2D.WrapMode.Tile);

        Graphics formGraphics = this.CreateGraphics();

        formGraphics.FillEllipse(texture, new RectangleF(90, 110,
 100,100));
        formGraphics.Dispose();
    }
    catch (System.IO.FileNotFoundException exp) {
        MessageBox.Show(("There was an error opening the bitmap."  
            + "Please check the path."));
    }
} //button2_Click
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
System.Drawing.Drawing2D 名前空間



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「WrapMode 列挙体」の関連用語

WrapMode 列挙体のお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



WrapMode 列挙体のページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2024 Microsoft.All rights reserved.

©2024 GRAS Group, Inc.RSS