c#图像旋转和翻转

来源:互联网 发布:js 函数 传递字符串 编辑:程序博客网 时间:2024/04/29 09:42
 
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Text;
  7. using System.Windows.Forms;
  8. namespace WindowsApplication2
  9. {
  10.     public partial class Form17 : Form
  11.     {
  12.         public Form17()
  13.         {
  14.             InitializeComponent();
  15.         }
  16.         private void button1_Click(object sender, EventArgs e)
  17.         {
  18.             using (Bitmap bmp = new Bitmap(@"d:/我的文档/桌面/ico/watermark.bmp"))
  19.             {
  20.                 Graphics g = this.CreateGraphics();
  21.                 Rectangle rect = new Rectangle(0, 0, 100, 100);
  22.                 //bmp.RotateFlip(RotateFlipType.Rotate90FlipNone);
  23.                 bmp.RotateFlip(RotateFlipType.RotateNoneFlipX);
  24.                 g.DrawImage(bmp, rect);
  25.             }
  26.         }
  27.       
  28.     }
  29. }
原创粉丝点击