请问如果让图片进行水平翻转 请问如果让图片进行水平翻转 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 如果用WinForm里的PictuerBox。应该有相应的方法可以转。 public Bitmap Test(Bitmap image1) { Bitmap image2=new Bitmap(); int width=image1.Width; int height=image1.Height; Color color1; Color color2; for (int i = 0; i < width; i++) { for (int j = 0; j < height; j++) { color1 = image1.GetPixel(i, j); image2.SetPixel(width-i, height-j); } } return image2; }提供一个思路参考一下,记事本写的,没有开发环境,编译不了,不好意思。 image2.SetPixel(width-i, height-j)=color1; YourImage.RotateFlip(RotateFlipType.Rotate180FlipY); private void button1_Click(object sender, EventArgs e){ Bitmap vBitmap = new Bitmap(@"C:\WINDOWS\winnt.bmp"); Graphics vGraphics = CreateGraphics(); vGraphics.Transform = new System.Drawing.Drawing2D.Matrix( -1, 0, 0, 1, vBitmap.Width, 0); vGraphics.DrawImage(vBitmap, 0, 0, vBitmap.Width, vBitmap.Height); vGraphics.Dispose();} 分享一个优秀的开源ORM框架 -- petaPoco PrintDocument打印预览正常,打印时错位的问题 VISTA HOME BASIC 无法安装IIS 高人请教 请教一个在VSTS下获取WorkItem的问题 用OLEDB打开excel文件遇到的问题????????? access远程写入sql 在用C#编写Windows组件时的问题? ==== 项目紧,求一句简单 sql 语句 ==== Oracle与sql server的应用上的区别 水晶报表显示问题? 求只能输入1-31和99这32个数的正则表达式 求救!!!!!!!!!!!!!!!!
{
Bitmap image2=new Bitmap();
int width=image1.Width;
int height=image1.Height;
Color color1;
Color color2;
for (int i = 0; i < width; i++)
{
for (int j = 0; j < height; j++)
{
color1 = image1.GetPixel(i, j);
image2.SetPixel(width-i, height-j);
}
}
return image2;
}
提供一个思路参考一下,记事本写的,没有开发环境,编译不了,不好意思。
{
Bitmap vBitmap = new Bitmap(@"C:\WINDOWS\winnt.bmp");
Graphics vGraphics = CreateGraphics();
vGraphics.Transform = new System.Drawing.Drawing2D.Matrix(
-1, 0, 0, 1, vBitmap.Width, 0);
vGraphics.DrawImage(vBitmap, 0, 0, vBitmap.Width, vBitmap.Height);
vGraphics.Dispose();
}