TextureBrush 클래스

정의

TextureBrush 클래스의 각 속성은 이미지를 사용하여 도형 내부를 채우는 Brush 개체입니다. 이 클래스는 상속될 수 없습니다.

public ref class TextureBrush sealed : System::Drawing::Brush
public sealed class TextureBrush : System.Drawing.Brush
type TextureBrush = class
    inherit Brush
Public NotInheritable Class TextureBrush
Inherits Brush
상속

예제

다음 코드 예제에서는 메서드를 사용 하 여 새 비트맵을 FromFile 가져오는 방법을 보여 줍니다. 또한 을 TextureBrush보여 줍니다.

이 예제는 Windows Forms 사용하도록 설계되었습니다. Button2라는 단추가 포함된 폼을 Create. 코드를 양식에 붙여넣고 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

설명

참고

.NET 6 이상 버전에서는 이 형식을 포함하는 System.Drawing.Common 패키지가 Windows 운영 체제에서만 지원됩니다. 플랫폼 간 앱에서 이 형식을 사용하면 컴파일 시간 경고 및 런타임 예외가 발생합니다. 자세한 내용은 Windows에서만 지원되는 System.Drawing.Common을 참조하세요.

생성자

TextureBrush(Image)

지정된 이미지를 사용하는 새 TextureBrush 개체를 초기화합니다.

TextureBrush(Image, Rectangle)

지정된 이미지 및 경계 사각형을 사용하는 새 TextureBrush 개체를 초기화합니다.

TextureBrush(Image, Rectangle, ImageAttributes)

지정된 이미지, 경계 사각형 및 이미지 특성을 사용하는 새 TextureBrush 개체를 초기화합니다.

TextureBrush(Image, RectangleF)

지정된 이미지 및 경계 사각형을 사용하는 새 TextureBrush 개체를 초기화합니다.

TextureBrush(Image, RectangleF, ImageAttributes)

지정된 이미지, 경계 사각형 및 이미지 특성을 사용하는 새 TextureBrush 개체를 초기화합니다.

TextureBrush(Image, WrapMode)

지정된 이미지 및 랩 모드를 사용하는 새 TextureBrush 개체를 초기화합니다.

TextureBrush(Image, WrapMode, Rectangle)

지정된 이미지, 랩 모드 및 경계 사각형을 사용하는 새 TextureBrush 개체를 초기화합니다.

TextureBrush(Image, WrapMode, RectangleF)

지정된 이미지, 랩 모드 및 경계 사각형을 사용하는 새 TextureBrush 개체를 초기화합니다.

속성

Image

Image 개체와 관련된 TextureBrush 개체를 가져옵니다.

Transform

Matrix 개체와 관련된 이미지의 로컬 기하학적 변환을 정의하는 TextureBrush 개체의 복사본을 가져오거나 설정합니다.

WrapMode

WrapMode 개체의 랩 모드를 나타내는 TextureBrush 열거형을 가져오거나 설정합니다.

메서드

Clone()

TextureBrush 개체의 정확한 복사본을 만듭니다.

CreateObjRef(Type)

원격 개체와 통신하는 데 사용되는 프록시 생성에 필요한 모든 관련 정보가 들어 있는 개체를 만듭니다.

(다음에서 상속됨 MarshalByRefObject)
Dispose()

Brush 개체에서 사용하는 리소스를 모두 해제합니다.

(다음에서 상속됨 Brush)
Dispose(Boolean)

Brush에서 사용하는 관리되지 않는 리소스를 해제하고, 관리되는 리소스를 선택적으로 해제할 수 있습니다.

(다음에서 상속됨 Brush)
Equals(Object)

지정된 개체가 현재 개체와 같은지 확인합니다.

(다음에서 상속됨 Object)
GetHashCode()

기본 해시 함수로 작동합니다.

(다음에서 상속됨 Object)
GetLifetimeService()
사용되지 않음.

이 인스턴스의 수명 정책을 제어하는 현재의 수명 서비스 개체를 검색합니다.

(다음에서 상속됨 MarshalByRefObject)
GetType()

현재 인스턴스의 Type을 가져옵니다.

(다음에서 상속됨 Object)
InitializeLifetimeService()
사용되지 않음.

이 인스턴스의 수명 정책을 제어하는 수명 서비스 개체를 가져옵니다.

(다음에서 상속됨 MarshalByRefObject)
MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
MemberwiseClone(Boolean)

현재 MarshalByRefObject 개체의 단순 복사본을 만듭니다.

(다음에서 상속됨 MarshalByRefObject)
MultiplyTransform(Matrix)

TextureBrush 개체의 로컬 기하학적 변형을 나타내는 Matrix 개체에 지정된 Matrix 개체를 앞에 추가하여 지정된 Matrix 개체를 곱합니다.

MultiplyTransform(Matrix, MatrixOrder)

TextureBrush 개체의 로컬 기하학적 변형을 나타내는 Matrix 개체에 지정된 순서로 지정된 Matrix 개체를 곱합니다.

ResetTransform()

식별할 이 TextureBrush 개체의 Transform 속성을 다시 설정합니다.

RotateTransform(Single)

TextureBrush 개체의 로컬 기하학적 변형을 지정된 크기만큼 회전합니다. 이 메서드는 회전을 변형 앞에 추가합니다.

RotateTransform(Single, MatrixOrder)

TextureBrush 개체의 로컬 기하학적 변형을 지정된 순서로 지정된 크기만큼 회전합니다.

ScaleTransform(Single, Single)

지정된 크기로 이 TextureBrush 개체의 로컬 기하학적 변환을 조정합니다. 이 메서드는 변환에 크기 조정 매트릭스를 추가합니다.

ScaleTransform(Single, Single, MatrixOrder)

TextureBrush 개체의 로컬 기하학적 변형을 지정된 순서로 지정된 크기만큼 조정합니다.

SetNativeBrush(IntPtr)

파생 클래스에서 GDI+ 브러시 개체에 대한 참조를 설정합니다.

(다음에서 상속됨 Brush)
ToString()

현재 개체를 나타내는 문자열을 반환합니다.

(다음에서 상속됨 Object)
TranslateTransform(Single, Single)

TextureBrush 개체의 로컬 기하학적 변형을 지정된 크기만큼 이동합니다. 이 메서드는 이동을 변형 앞에 추가합니다.

TranslateTransform(Single, Single, MatrixOrder)

지정된 순서로 지정된 크기만큼 이 TextureBrush 개체의 로컬 기하학적 변형을 이동합니다.

적용 대상