RotateFlipType 열거형

정의

이미지가 회전되는 양과 이미지를 대칭 이동하는 데 사용할 축을 지정합니다.

public enum class RotateFlipType
public enum RotateFlipType
type RotateFlipType = 
Public Enum RotateFlipType
상속
RotateFlipType

필드

Rotate180FlipNone 2

대칭 이동 없는 180도 시계 방향 회전을 지정합니다.

Rotate180FlipX 6

수평 대칭 이동 후 180도 시계 방향 회전을 지정합니다.

Rotate180FlipXY 0

수평 및 수직 이동 후 180도 시계 방향 회전을 지정합니다.

Rotate180FlipY 4

수직 대칭 이동 후 180도 시계 방향 회전을 지정합니다.

Rotate270FlipNone 3

대칭 이동 없는 270도 시계 방향 회전을 지정합니다.

Rotate270FlipX 7

수평 대칭 이동 후 270도 시계 방향 회전을 지정합니다.

Rotate270FlipXY 1

수평 및 수직 이동 후 270도 시계 방향 회전을 지정합니다.

Rotate270FlipY 5

수직 대칭 이동 후 270도 시계 방향 회전을 지정합니다.

Rotate90FlipNone 1

대칭 이동 없는 90도 시계 방향 회전을 지정합니다.

Rotate90FlipX 5

수평 대칭 이동 후 90도 시계 방향 회전을 지정합니다.

Rotate90FlipXY 3

수평 및 수직 이동 후 90도 시계 방향 회전을 지정합니다.

Rotate90FlipY 7

수직 대칭 이동 후 90도 시계 방향 회전을 지정합니다.

RotateNoneFlipNone 0

시계 방향 회전 안 함과 대칭 이동 안 함을 지정합니다.

RotateNoneFlipX 4

수평 대칭 이동 후 시계 방향 회전 안 함을 지정합니다.

RotateNoneFlipXY 2

수평 및 수직 대칭 이동 후 시계 방향 회전 안 함을 지정합니다.

RotateNoneFlipY 6

수직 대칭 이동 후 시계 방향 회전 안 함을 지정합니다.

예제

다음 코드 예제를 설정 RotateFlip 하는 방법에 설명 합니다 의 Image 속성을 및 RotateFlipType 열거형입니다.

이 예제는 라는 단추와 라는 PictureBox1Button1단추가 포함된 PictureBox Windows Form과 함께 사용하도록 설계되었습니다. 폼에 코드를 붙여넣고, 폼의 생성자 또는 Load 이벤트 처리 메서드에서 를 호출 InitializeBitmap 하고, 단추의 Click 이벤트와 연결 Button1_Click 합니다. 시스템에서 비트맵의 파일 경로가 유효한지 확인합니다.

Bitmap^ bitmap1;
void InitializeBitmap()
{
   try
   {
      bitmap1 = dynamic_cast<Bitmap^>(Bitmap::FromFile( "C:\\Documents and Settings\\"
      "All Users\\Documents\\My Music\\music.bmp" ));
      PictureBox1->SizeMode = PictureBoxSizeMode::AutoSize;
      PictureBox1->Image = bitmap1;
   }
   catch ( System::IO::FileNotFoundException^ ) 
   {
      MessageBox::Show( "There was an error."
      "Check the path to the bitmap." );
   }

}

void Button1_Click( System::Object^ /*sender*/, System::EventArgs^ /*e*/ )
{
   if ( bitmap1 != nullptr )
   {
      bitmap1->RotateFlip( RotateFlipType::Rotate180FlipY );
      PictureBox1->Image = bitmap1;
   }
}
Bitmap bitmap1;

private void InitializeBitmap()
{
    try
    {
        bitmap1 = (Bitmap)Bitmap.FromFile(@"C:\Documents and Settings\" + 
            @"All Users\Documents\My Music\music.bmp");
        PictureBox1.SizeMode = PictureBoxSizeMode.AutoSize;
        PictureBox1.Image = bitmap1;
    }
    catch(System.IO.FileNotFoundException)
    {
        MessageBox.Show("There was an error." + 
            "Check the path to the bitmap.");
    }
}

private void Button1_Click(System.Object sender, System.EventArgs e)
{

    if (bitmap1 != null)
    {
        bitmap1.RotateFlip(RotateFlipType.Rotate180FlipY);
        PictureBox1.Image = bitmap1;
    }
}
Dim bitmap1 As Bitmap

Private Sub InitializeBitmap()
    Try
        bitmap1 = CType(Bitmap.FromFile("C:\Documents and Settings\All Users\" _
            & "Documents\My Music\music.bmp"), Bitmap)
        PictureBox1.SizeMode = PictureBoxSizeMode.AutoSize
        PictureBox1.Image = bitmap1
    Catch ex As System.IO.FileNotFoundException
        MessageBox.Show("There was an error. Check the path to the bitmap.")
    End Try


End Sub

Private Sub Button1_Click(ByVal sender As System.Object, _
    ByVal e As System.EventArgs) Handles Button1.Click

    If bitmap1 IsNot Nothing Then
        bitmap1.RotateFlip(RotateFlipType.Rotate180FlipY)
        PictureBox1.Image = bitmap1
    End If

End Sub

설명

이미지가 시계 방향으로 회전됩니다.

적용 대상