c# 实现图像180度旋转
2012-11-07 17:26
337 查看
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
Bitmap bitmap1;
private void InitializeBitmap()
{
try
{
bitmap1 = (Bitmap)Properties.Resources.a;
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;
}
}
private void Form1_Load(object sender, EventArgs e)
{
InitializeBitmap();
}
}
}
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
Bitmap bitmap1;
private void InitializeBitmap()
{
try
{
bitmap1 = (Bitmap)Properties.Resources.a;
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;
}
}
private void Form1_Load(object sender, EventArgs e)
{
InitializeBitmap();
}
}
}
相关文章推荐
- 图像旋转c代码实现(90度, -90度, 180度)
- 最近邻图像旋转代码 灰度图像 c++实现
- C# 图片盖章功能实现,支持拖拽-旋转-放缩-保存
- 图像旋转原理及实现
- 图像旋转算法与实现
- [opencv] 图像旋转180度要注意的细节问题
- OpenCV实现图像的旋转
- C# 图像验证码的实现
- opencv实现图像做镜像和旋转
- 图像旋转使用CImage实现
- 关于vc中实现图像旋转的看法
- 图像旋转的原理,实现与优化
- C#实现图像缩略图的代码
- 图像旋转算法与实现
- 【数字图像处理】C++读取、旋转和保存bmp图像文件编程实现
- 图像旋转算法与实现
- 图像相似度算法的C#实现及测评
- jq实现图像旋转木马:轮焦点+关于控制+自己主动旋转木马
- C#实现任意角度旋转图片(方法1)
- C#实现字体旋转的方法