当前位置: 首页 > news >正文

需要企业网站开发百度排名点击软件

需要企业网站开发,百度排名点击软件,网站开发公司联系电话,广西省桂林市方法一:直接修改RGB的值 首先将BitmapData扫描线上的所有像素复制到字节数组中,然后遍历数组并对每个像素的RGB值进行修改,最后将修改后的像素值复制回BitmapData。这个过程不会影响原始的Bitmap对象,但会改变锁定的位图区域的数…

方法一:直接修改RGB的值

首先将BitmapData扫描线上的所有像素复制到字节数组中,然后遍历数组并对每个像素的RGB值进行修改,最后将修改后的像素值复制回BitmapData。这个过程不会影响原始的Bitmap对象,但会改变锁定的位图区域的数据。当完成修改后,应调用UnlockBits()方法释放锁定的位图区域。
 

System.Drawing.Bitmap bitBufferRGB = new System.Drawing.Bitmap("彩色Bitmap图像.jpg");
System.Drawing.Imaging.BitmapData data = bitBufferRGB.LockBits(
new System.Drawing.Rectangle(System.Drawing.Point.Empty, bitBufferRGB.Size),
System.Drawing.Imaging.ImageLockMode.ReadWrite, bitBufferRGB.PixelFormat);//获取内存
IntPtr pData = data.Scan0;
int bytes = data.Stride * bitBufferRGB.Height;
byte[] rgbValues = new byte[bytes];// Copy the RGB values into the array.
System.Runtime.InteropServices.Marshal.Copy(pData, rgbValues, 0, bytes);for (int y = 0; y < bitBufferRGB.Height; y++)
{for (int x = 0; x < bitBufferRGB.Width; x++){// 获取像素(x, y)在数组中的索引。int index = y * data.Stride + x * 3;// 修改RGB值。rgbValues[index] = (byte)(rgbValues[index] * 0.9); // 修改红色分量rgbValues[index + 1] = (byte)(rgbValues[index + 1] * 0.7); // 修改绿色分量rgbValues[index + 2] = (byte)(rgbValues[index + 2] * 0.9); // 修改蓝色分量}
}// Copy the modified RGB values back to the bitmap.
System.Runtime.InteropServices.Marshal.Copy(rgbValues, 0, pData, bytes);//解锁及释放资源
bitBufferRGB.UnlockBits(data);
bitBufferRGB.Dispose();

方法二:更换RGB的值位置

更换R和B的位置

System.Drawing.Bitmap bitBufferRGB = new System.Drawing.Bitmap("彩色Bitmap图像.jpg");
System.Drawing.Imaging.BitmapData data = bitBufferRGB.LockBits(
new System.Drawing.Rectangle(System.Drawing.Point.Empty, bitBufferRGB.Size),
System.Drawing.Imaging.ImageLockMode.ReadWrite, bitBufferRGB.PixelFormat);//获取内存
IntPtr pData = data.Scan0;
int bytes = data.Stride * bitBufferRGB.Height;
byte[] rgbValues = new byte[bytes];
System.Runtime.InteropServices.Marshal.Copy(pData, rgbValues, 0, bytes);for (int i = 0; i < height; i++)
{for (int ji = 0; ji < width; ji++){int index = i * width + ji;// 每个像素占用三个字节// 红色字节rgbValues[index * 3] = System.Runtime.InteropServices.Marshal.ReadByte(pData, index * 3 + 2);// 绿色字节rgbValues[index * 3 + 1] = System.Runtime.InteropServices.Marshal.ReadByte(pData, index * 3 + 1);// 蓝色字节rgbValues[index * 3 + 2] = System.Runtime.InteropServices.Marshal.ReadByte(pData, index * 3);}
}
System.Runtime.InteropServices.Marshal.Copy(rgbValues, 0, pData, bytes);//解锁及释放资源
bitBufferRGB.UnlockBits(data);
bitBufferRGB.Dispose();

 

 

 

 

 

http://www.15wanjia.com/news/39052.html

相关文章:

  • 许昌抖音推广公司廊坊首页霸屏排名优化
  • 网站建设专业的百度知道首页网
  • lazy load wordpress石嘴山网站seo
  • 网站宣传的方法自媒体推广渠道
  • 湖北营销型网站建设公司电脑版百度网盘
  • 中山手机网站建设价格个人怎么做网络推广
  • 一个企业做网站推广的优势seo营销方案
  • 卖菜网站应该怎么做看网站搜索什么关键词
  • asp做网站基本过程网络营销服务公司
  • 济南教育平台网站建设公司企业网站建设
  • linux做网站优势网上做广告宣传
  • 司法厅网站建设方案营销宣传方式有哪些
  • 哪个网站可以自己做行程网络推广需要什么
  • 如何修改网站后台的用户名和密码百度指数数据下载
  • 免费网站模板的制作方法西安网站seo外包
  • 河南郑州汽车网网站建设网络营销推广工作内容
  • javascript手机编程软件seo教程seo优化
  • 潍坊企业做网站百度seo工具
  • 如何免费做网站推广百度爱采购推广效果怎么样?
  • 电商网站制作流程图上海的重大新闻
  • 顺义重庆网站建设文山seo公司
  • 电子商务网站建设 上海竞价推广外包托管
  • wordpress挂下载链接短视频搜索优化
  • 做网站宁波大点的网络公司中国新闻网发稿
  • 武汉网站设计武女教师遭网课入侵视频大全播放
  • 二手房网站怎么做才能接到电话seo查询 工具
  • 做网站要钱嘛网络服务器多少钱一台
  • 如何去掉一页wordpress北京百度seo排名
  • 签订网站建设合同需要注意什么西安seo排名收费
  • 商务网站可以做哪些seo诊断分析报告