c#图像反转
usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Da...
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Linq;
using System.Text;
using System.Drawing.Imaging;
using System.Windows.Forms;
namespace WindowsFormsApplication30
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
OpenFileDialog ofd = new OpenFileDialog();
ofd.Filter = "BMP File(*bmp)|*.bmp|GIF File(*.gif)|*.gif";
if (ofd.ShowDialog() == DialogResult.OK)
{
Bitmap image = new Bitmap(ofd.FileName);
image.Save("SaveFile.bmp", ImageFormat.Bmp);
}
}
private void button2_Click(object sender, EventArgs e)
{
Graphics g = this.CreateGraphics();
Image image = new Bitmap("SaveFile.bmp");
TextureBrush tb = new TextureBrush(image);
Pen bp = new Pen(Color.Black);
g.FillRectangle(tb,new Rectangle(0,0,300,200));
}
private void button3_Click(object sender, EventArgs e)
{
Graphics g = this.CreateGraphics();
Image image = new Bitmap("SaveFile.bmp");
TextureBrush txb = new TextureBrush(image);
Pen bp = new Pen(Color.Black);
txb.WrapMode = WrapMode.TileFlipX;
g.FillRectangle(txb,new Rectangle(0,0,200,200));
g.DrawRectangle(bp,new Rectangle(0,0,200,200));
}
}
}
button3是实现图像翻转的代码,可是为什么没有成功??? 展开
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Linq;
using System.Text;
using System.Drawing.Imaging;
using System.Windows.Forms;
namespace WindowsFormsApplication30
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
OpenFileDialog ofd = new OpenFileDialog();
ofd.Filter = "BMP File(*bmp)|*.bmp|GIF File(*.gif)|*.gif";
if (ofd.ShowDialog() == DialogResult.OK)
{
Bitmap image = new Bitmap(ofd.FileName);
image.Save("SaveFile.bmp", ImageFormat.Bmp);
}
}
private void button2_Click(object sender, EventArgs e)
{
Graphics g = this.CreateGraphics();
Image image = new Bitmap("SaveFile.bmp");
TextureBrush tb = new TextureBrush(image);
Pen bp = new Pen(Color.Black);
g.FillRectangle(tb,new Rectangle(0,0,300,200));
}
private void button3_Click(object sender, EventArgs e)
{
Graphics g = this.CreateGraphics();
Image image = new Bitmap("SaveFile.bmp");
TextureBrush txb = new TextureBrush(image);
Pen bp = new Pen(Color.Black);
txb.WrapMode = WrapMode.TileFlipX;
g.FillRectangle(txb,new Rectangle(0,0,200,200));
g.DrawRectangle(bp,new Rectangle(0,0,200,200));
}
}
}
button3是实现图像翻转的代码,可是为什么没有成功??? 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询