ImageAttributes.SetWrapMode 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
랩 모드를 설정합니다.
오버로드
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)
매개 변수
예제
다음 코드 예제는 Windows Forms 사용하도록 설계되었으며 이벤트 처리기의 Paint 매개 변수인 가 필요합니다.PaintEventArgse
코드는 다음 작업을 수행합니다.
ImageCircle3.jpg 파일(빨간색으로 채워진 작은 원)에서 를 열고 화면에 그립니다.
개체를 ImageAttributes 만들고 열거형을 WrapMode 로 Tile설정합니다.
TextureBrushCircle3.jpg 파일의 이미지를 사용하여 을 만듭니다.
빨간색으로 채워진 작은 원으로 채워진 화면에 사각형을 그립니다.
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)
매개 변수
- 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)
매개 변수
- color
- Color
렌더링된 이미지 외부의 픽셀 색을 지정하는 색 개체입니다. 이 색은 모드 매개 변수가 Clamp로 설정되어 있고, DrawImage에 전달된 원본 사각형이 이미지 자체보다 큰 경우 표시됩니다.
- clamp
- Boolean
이 매개 변수는 아무런 영향을 주지 않습니다. false
로 설정합니다.
예제
코드 예제는 메서드를 참조하세요 SetWrapMode(WrapMode) .
적용 대상
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기