Image.RotateFlip メソッド
アセンブリ: System.Drawing (system.drawing.dll 内)

戻り値
このメソッドは値を返しません。

Image の RotateFlip プロパティと RotateFlipType 列挙体を設定する方法を次のコード例に示します。
この例は、PictureBox1 という名前の PictureBox と Button1 という名前のボタンを含んだ Windows フォームでの使用を意図してデザインされています。コードをフォームに貼り付け、フォームのコンストラクタから InitializeBitmap を呼び出し、Button1_Click をボタンの Click イベントに関連付けます。ビットマップへのファイル パスがシステム上で有効なことを確認してください。
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 Not bitmap1 Is Nothing Then bitmap1.RotateFlip(RotateFlipType.Rotate180FlipY) PictureBox1.Image = bitmap1 End If End Sub
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; } }
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; } }
private Bitmap bitmap1; private void InitializeBitmap() { try { bitmap1 = ((Bitmap)(Bitmap.FromFile(("C:\\Documents and Settings\\" + "All Users\\Documents\\My Music\\music.bmp")))); pictureBox1.set_SizeMode(PictureBoxSizeMode.AutoSize); pictureBox1.set_Image(bitmap1); } catch (System.IO.FileNotFoundException exp) { MessageBox.Show(("There was an error." + "Check the path to the bitmap.")); } } //InitializeBitmap private void button1_Click(Object sender, System.EventArgs e) { if (bitmap1 != null) { bitmap1.RotateFlip(RotateFlipType.Rotate180FlipY); pictureBox1.set_Image(bitmap1); } } //button1_Click

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からImage.RotateFlip メソッドを検索する場合は、下記のリンクをクリックしてください。

- Image.RotateFlip メソッドのページへのリンク