--------------------编程问答--------------------
Graphics g = pictureBox2.CreateGraphics();
g.FillRectangle(Brushes.White, this.ClientRectangle);//填充窗体背景为白色
Point[] destinationPoints = {
new Point(100, 0), // destination for upper-left point of original
new Point(100, 100),// destination for upper-right point of original
new Point(0, 0)}; // destination for lower-left point of original
g.DrawImage(pictureBox1.Image, destinationPoints);
--------------------编程问答--------------------
这段代码该怎么用呢?
--------------------编程问答--------------------
跟着你的代码后面
--------------------编程问答--------------------
不好用啊斑竹,跟在哪段后面呢,我想让旋转后的图片显示在pictureBox2,并且另外保存起来啊。。
--------------------编程问答--------------------
什么问题。你原来的代码对不对。
--------------------编程问答--------------------
Graphics g = e.Graphics;
Bitmap bmp = new Bitmap(@"C:\Users\Administrator\Desktop\1.jpg");//加载图像
g.FillRectangle(Brushes.White, this.ClientRectangle);//填充窗体背景为白色
Point[] destinationPoints = {
new Point(100, 0), // destination for upper-left point of original
new Point(100, 100),// destination for upper-right point of original
new Point(0, 0)}; // destination for lower-left point of original
g.DrawImage(bmp, destinationPoints);
bool bRotate = false;
private void Form11_Paint(object sender, PaintEventArgs e)
{
if (bRotate)
{
Graphics g = pictureBox2.CreateGraphics();
g.FillRectangle(Brushes.White, this.ClientRectangle);//填充窗体背景为白色
Point[] destinationPoints = {
new Point(100, 0), // destination for upper-left point of original
new Point(100, 100),// destination for upper-right point of original
new Point(0, 0)}; // destination for lower-left point of original
g.DrawImage(pictureBox1.Image, destinationPoints);
}
}