c# 中 我要对图片进行按一定角度旋转,我是这样写的
TextureBrush MyBrush=new TextureBrush(tmpBmp);
this.picPreview.Refresh();
e.Graphics.TranslateTransform(iRotX,iRotY);
MyBrush.RotateTransform(iAngle);
e.Graphics.TranslateTransform(-iRotX,-iRotY);
e.Graphics.FillRectangle(MyBrush,0,0,this.ClientRectangle.Width,this.ClientRectangle.Height);
因为 有的图片需要截取,所以我希望在此代码中能截取,希望高手能够指点一下 谢谢
TextureBrush MyBrush=new TextureBrush(tmpBmp);
this.picPreview.Refresh();
e.Graphics.TranslateTransform(iRotX,iRotY);
MyBrush.RotateTransform(iAngle);
e.Graphics.TranslateTransform(-iRotX,-iRotY);
e.Graphics.FillRectangle(MyBrush,0,0,this.ClientRectangle.Width,this.ClientRectangle.Height);
因为 有的图片需要截取,所以我希望在此代码中能截取,希望高手能够指点一下 谢谢
获取新bitmap的对应Graphics,用DrawImage把原tmpBmp指定位置画进新bitmap里
DrawImage(要切的图, New Rectangle(要画到哪里?X坐标,要画到哪里?Y坐标, 要画多长?, 要画多高?), New Rectangle(从源图哪里开始切?X坐标, 从源图哪里开始切?Y坐标, 要切多长, 要切多高?), GraphicsUnit.Pixel)