다음을 통해 공유


ImageAttributes.SetWrapMode 메서드

정의

랩 모드를 설정합니다.

오버로드

SetWrapMode(WrapMode)

질감을 도형 전체에 또는 도형 경계에 바둑판식으로 배열하는 방법을 결정하는 데 사용되는 랩 모드를 설정합니다. 질감이 채우려는 도형보다 작은 경우에는 채울 도형 전체에 질감이 바둑판식으로 배열됩니다.

SetWrapMode(WrapMode, Color)

질감을 도형 전체에 또는 도형 경계에 바둑판식으로 배열하는 방법을 결정하는 데 사용되는 래핑 모드 및 색을 설정합니다. 질감이 채우려는 도형보다 작은 경우에는 채울 도형 전체에 질감이 바둑판식으로 배열됩니다.

SetWrapMode(WrapMode, Color, Boolean)

질감을 도형 전체에 또는 도형 경계에 바둑판식으로 배열하는 방법을 결정하는 데 사용되는 래핑 모드 및 색을 설정합니다. 질감이 채우려는 도형보다 작은 경우에는 채울 도형 전체에 질감이 바둑판식으로 배열됩니다.

SetWrapMode(WrapMode)

Source:
ImageAttributes.cs
Source:
ImageAttributes.cs
Source:
ImageAttributes.cs

질감을 도형 전체에 또는 도형 경계에 바둑판식으로 배열하는 방법을 결정하는 데 사용되는 랩 모드를 설정합니다. 질감이 채우려는 도형보다 작은 경우에는 채울 도형 전체에 질감이 바둑판식으로 배열됩니다.

public:
 void SetWrapMode(System::Drawing::Drawing2D::WrapMode mode);
public void SetWrapMode (System.Drawing.Drawing2D.WrapMode mode);
member this.SetWrapMode : System.Drawing.Drawing2D.WrapMode -> unit
Public Sub SetWrapMode (mode As WrapMode)

매개 변수

mode
WrapMode

이미지의 반복 복사본을 사용하여 영역을 바둑판식으로 배열하는 방법을 지정하는 WrapMode의 요소입니다.

예제

다음 코드 예제는 Windows Forms 사용하도록 설계되었으며 이벤트 처리기의 Paint 매개 변수인 가 필요합니다.PaintEventArgse 코드는 다음 작업을 수행합니다.

  1. ImageCircle3.jpg 파일(빨간색으로 채워진 작은 원)에서 를 열고 화면에 그립니다.

  2. 개체를 ImageAttributes 만들고 열거형을 WrapModeTile설정합니다.

  3. TextureBrushCircle3.jpg 파일의 이미지를 사용하여 을 만듭니다.

  4. 빨간색으로 채워진 작은 원으로 채워진 화면에 사각형을 그립니다.

void SetWrapModeExample( PaintEventArgs^ e )
{
   // Create a filled, red circle, and save it to Circle3.jpg.
   Bitmap^ myBitmap = gcnew Bitmap( 50,50 );
   Graphics^ g = Graphics::FromImage( myBitmap );
   g->Clear( Color::White );
   g->FillEllipse( gcnew SolidBrush( Color::Red ), Rectangle(0,0,25,25) );
   myBitmap->Save( "Circle3.jpg" );

   // Create an Image object from the Circle3.jpg file, and draw it
   // to the screen.
   Image^ myImage = Image::FromFile( "Circle3.jpg" );
   e->Graphics->DrawImage( myImage, 20, 20 );

   // Set the wrap mode.
   ImageAttributes^ imageAttr = gcnew ImageAttributes;
   imageAttr->SetWrapMode( WrapMode::Tile );

   // Create a TextureBrush.
   Rectangle brushRect = Rectangle(0,0,25,25);
   TextureBrush^ myTBrush = gcnew TextureBrush( myImage,brushRect,imageAttr );

   // Draw to the screen a rectangle filled with red circles.
   e->Graphics->FillRectangle( myTBrush, 100, 20, 200, 200 );
}
private void SetWrapModeExample(PaintEventArgs e)
{
             
    // Create a filled, red circle, and save it to Circle3.jpg.
    Bitmap myBitmap = new Bitmap(50, 50);
    Graphics g = Graphics.FromImage(myBitmap);
    g.Clear(Color.White);
    g.FillEllipse(new SolidBrush(Color.Red),
        new Rectangle(0, 0, 25, 25));
    myBitmap.Save("Circle3.jpg");
             
    // Create an Image object from the Circle3.jpg file, and draw it
    // to the screen.
    Image myImage = Image.FromFile("Circle3.jpg");
    e.Graphics.DrawImage(myImage, 20, 20);
             
    // Set the wrap mode.
    ImageAttributes imageAttr = new ImageAttributes();
    imageAttr.SetWrapMode(WrapMode.Tile);
             
    // Create a TextureBrush.
    Rectangle brushRect = new Rectangle(0,0,25,25);
    TextureBrush myTBrush = new TextureBrush(myImage, brushRect, imageAttr);
             
    // Draw to the screen a rectangle filled with red circles.
    e.Graphics.FillRectangle(myTBrush, 100, 20, 200, 200);
}
Public Sub SetWrapModeExample(ByVal e As PaintEventArgs)

    ' Create a filled, red circle, and save it to Circle3.jpg.
    Dim myBitmap As New Bitmap(50, 50)
    Dim g As Graphics = Graphics.FromImage(myBitmap)
    g.Clear(Color.White)
    g.FillEllipse(New SolidBrush(Color.Red), New Rectangle(0, 0, _
    25, 25))
    myBitmap.Save("Circle3.jpg")

    ' Create an Image object from the Circle3.jpg file, and draw

    ' it to the screen.
    Dim myImage As Image = Image.FromFile("Circle3.jpg")
    e.Graphics.DrawImage(myImage, 20, 20)

    ' Set the wrap mode.
    Dim imageAttr As New ImageAttributes
    imageAttr.SetWrapMode(WrapMode.Tile)

    ' Create a TextureBrush.
    Dim brushRect As New Rectangle(0, 0, 25, 25)
    Dim myTBrush As New TextureBrush(myImage, brushRect, imageAttr)

    ' Draw to the screen a rectangle filled with red circles.
    e.Graphics.FillRectangle(myTBrush, 100, 20, 200, 200)
End Sub

설명

메서드를 호출하는 SetWrapMode(WrapMode) 것은 매개 변수를 color 호출 SetWrapMode(WrapMode, Color) 하고 전달하는 Color.Black 것과 같습니다. Color.Black 는 렌더링된 이미지 외부의 픽셀 색을 지정합니다. 모드 매개 변수가 로 설정되고 메서드에 Clamp 전달된 DrawImage 원본 사각형이 이미지 자체보다 큰 경우 이 색이 표시됩니다.

적용 대상

SetWrapMode(WrapMode, Color)

Source:
ImageAttributes.cs
Source:
ImageAttributes.cs
Source:
ImageAttributes.cs

질감을 도형 전체에 또는 도형 경계에 바둑판식으로 배열하는 방법을 결정하는 데 사용되는 래핑 모드 및 색을 설정합니다. 질감이 채우려는 도형보다 작은 경우에는 채울 도형 전체에 질감이 바둑판식으로 배열됩니다.

public:
 void SetWrapMode(System::Drawing::Drawing2D::WrapMode mode, System::Drawing::Color color);
public void SetWrapMode (System.Drawing.Drawing2D.WrapMode mode, System.Drawing.Color color);
member this.SetWrapMode : System.Drawing.Drawing2D.WrapMode * System.Drawing.Color -> unit
Public Sub SetWrapMode (mode As WrapMode, color As Color)

매개 변수

mode
WrapMode

이미지의 반복 복사본을 사용하여 영역을 바둑판식으로 배열하는 방법을 지정하는 WrapMode의 요소입니다.

color
Color

렌더링된 이미지 외부의 픽셀 색을 지정하는 ImageAttributes 개체입니다. 이 색은 모드 매개 변수가 Clamp로 설정되어 있고, DrawImage에 전달된 원본 사각형이 이미지 자체보다 큰 경우 표시됩니다.

예제

코드 예제는 메서드를 참조하세요 SetWrapMode(WrapMode) .

적용 대상

SetWrapMode(WrapMode, Color, Boolean)

Source:
ImageAttributes.cs
Source:
ImageAttributes.cs
Source:
ImageAttributes.cs

질감을 도형 전체에 또는 도형 경계에 바둑판식으로 배열하는 방법을 결정하는 데 사용되는 래핑 모드 및 색을 설정합니다. 질감이 채우려는 도형보다 작은 경우에는 채울 도형 전체에 질감이 바둑판식으로 배열됩니다.

public:
 void SetWrapMode(System::Drawing::Drawing2D::WrapMode mode, System::Drawing::Color color, bool clamp);
public void SetWrapMode (System.Drawing.Drawing2D.WrapMode mode, System.Drawing.Color color, bool clamp);
member this.SetWrapMode : System.Drawing.Drawing2D.WrapMode * System.Drawing.Color * bool -> unit
Public Sub SetWrapMode (mode As WrapMode, color As Color, clamp As Boolean)

매개 변수

mode
WrapMode

이미지의 반복 복사본을 사용하여 영역을 바둑판식으로 배열하는 방법을 지정하는 WrapMode의 요소입니다.

color
Color

렌더링된 이미지 외부의 픽셀 색을 지정하는 색 개체입니다. 이 색은 모드 매개 변수가 Clamp로 설정되어 있고, DrawImage에 전달된 원본 사각형이 이미지 자체보다 큰 경우 표시됩니다.

clamp
Boolean

이 매개 변수는 아무런 영향을 주지 않습니다. false로 설정합니다.

예제

코드 예제는 메서드를 참조하세요 SetWrapMode(WrapMode) .

적용 대상