ヘッダー

VB.NET2002対応 VB.NET2003対応 VB2005対応

 

画像を反転させる

1.画像を左右反転させる

VB.NET2002対応 VB.NET2003対応 VB2005対応

PictureBox1.Image.RotateFlip(RotateFlipType.RotateNoneFlipX)
PictureBox1.Refresh()

メモ:PictureBox1にはあらかじめ画像を読み込んでおくなどしてImageプロパティに値をセットしておく必要があります。

 

2.画像を上下反転させる

 

VB.NET2002対応 VB.NET2003対応 VB2005対応

PictureBox1.Image.RotateFlip(RotateFlipType.RotateNoneFlipY)
PictureBox1.Refresh()

メモ:PictureBox1にはあらかじめ画像を読み込んでおくなどしてImageプロパティに値をセットしておく必要があります。

 

すぐに試せるサンプル

以下の例ではSample1.bmpを左右反転してPictureBox1に重ねて表示する。

サンプルを実行する前に必要なもの:

PictureBox1

C:\Sample1.bmp

VB.NET2002対応 VB.NET2003対応 VB2005対応

PictureBox1.Image = Image.FromFile("C:\Sample1.bmp")
PictureBox1.Image.RotateFlip(RotateFlipType.RotateNoneFlipX)

 


VB6対応  VB6ではPictureBoxPaintPictureメソッドを使用します。