GDI+入门(一)GDI+入门(二)画刷的使用GDI+入门(三、GDI+中文字操作)GDI+入门(四、GDI+入门 简单的图像处理)GDI+入门(五、在GDI+中绘制带动画效果的图片)GDI+入门(六、综合练习)GDI+入门(七、绘制表格数据)GDI+入门(八、坐标系的变化与图形变换GDI+入门(九、ASP.NET中GDI+)GDI+入门(十、GDI+实例——淡入淡出)GDI+入门(十一、GDI+实例——底片效果)GDI+入门(十二、GDI+实例——浮雕(刻雕)效果、) GDI+入门(十三、GDI+实例——灰度效果)GDI+入门(十四、GDI+实例——木刻效果)GDI+入门(十五、GDI+实例——光照效果)GDI+入门(十六、GDI+实例——柔化与锐化)GDI+入门(十七、GDI+实例——油画效果)GDI+入门(十八、GDI+实例——颜色矩阵)
[email protected]
谢楼主..
"cj520120"<[email protected]> 已发送
"xupeihua_asp_net"<[email protected]> 已发送
误会了,没看见
给我也发一份吧 [email protected]
[email protected]
我正在学GDI+呢,谢谢了,楼主
[email protected]
[email protected]
[email protected]已发送
[email protected]
已发送
[email protected]
谢楼主..
谢谢分享
我最近正在学这方面的东西
[email protected];
[email protected];
[email protected];
[email protected];
[email protected];
已发送
哥来了,给发一份。
已发送
[email protected]
用渐变画刷或者路径画刷http://blog.csdn.net/bobui/archive/2010/01/05/5136643.aspx
[email protected]
[email protected] 已收到
[email protected]
[email protected]
[email protected]
已发送,收到后请留言,没收到我再发一次
顶!谢谢!
谢谢
[email protected]
谢谢啦
谢谢楼主给我发一份啊
下面是个内存操作灰度的程序:bmp = new Bitmap(Application.StartupPath + "\\1.jpg");
Bitmap bmp2 = (Bitmap)bmp.Clone();
int width = bmp2.Width;
int height = bmp2.Height;
Rectangle rect = new Rectangle(0, 0, width, height);
//用可读写的方式锁定全部位图像素
BitmapData bmpData = bmp2.LockBits(rect, ImageLockMode.ReadWrite, bmp2.PixelFormat);
//得到首地址
IntPtr ptr = bmpData.Scan0;
//24位bmp位图字节数
int bytes = width * height * 3; byte[] rgbValues = new byte[bytes]; Marshal.Copy(ptr, rgbValues, 0, bytes); //灰度化
double colorTemp = 0;
for (int i = 0; i < bytes; i += 3)
{
colorTemp = rgbValues[i + 2] * 0.299 + rgbValues[i + 1] * 0.587 + rgbValues[i] * 0.114;
rgbValues[i] = rgbValues[i+1] = rgbValues[i+2] = (byte)colorTemp;
}
//还原位图
Marshal.Copy(rgbValues, 0, ptr, bytes);
bmp2.UnlockBits(bmpData);
Graphics g = this.CreateGraphics();
g.DrawImage(bmp2, new Rectangle(410, 0, 200, 200));
g.Dispose();
bmp2.Dispose();
已发送,收到后请留言,没收到我再发一次
Bitmap bmp2 = (Bitmap)bmp.Clone();
int width = bmp2.Width;
int height = bmp2.Height;
Rectangle rect = new Rectangle(0, 0, width, height);
//用可读写的方式锁定全部位图像素
BitmapData bmpData = bmp2.LockBits(rect, ImageLockMode.ReadWrite, bmp2.PixelFormat);
byte temp = 0;
//启用不安全模式
unsafe
{
//获取首地址
byte* ptr = (byte*)(bmpData.Scan0);
//二维图像循环
for (int i = 0; i < bmpData.Height; i++)
{
for (int j = 0; j < bmpData.Width; j++)
{
temp = (byte)(0.299 * ptr[2] + 0.587 * ptr[1] + 0.114 * ptr[0]);
ptr[0] = ptr[1] = ptr[2] = temp;
ptr += 3;
}
//指针移向下一行数组的首个字节
ptr += bmpData.Stride - bmpData.Width * 3;
}
bmp2.UnlockBits(bmpData);
}
Graphics g = this.CreateGraphics();
g.DrawImage(bmp2, new Rectangle(615, 0, 200, 200));
g.Dispose();
bmp2.Dispose();
[email protected]
已发送,收到后请留言,没收到我再发一次
我做了个照相程序,由于保存照相窗口后的图片很大,我缩小图片后,在缩小的图片上画了一个矩形框,然后保存矩形框内的图片,保存后的图像还是原来大图片的位置,请问这个问题应该怎样解决.
Bitmap s_image = new Bitmap(range.Width, range.Height);
Graphics s_graphics = Graphics.FromImage(s_image);
s_graphics.DrawImage(pictureBox1.Image, 0, 0, new RectangleF(range.X, range.Y, range.Width, range.Height), GraphicsUnit.Pixel);