怎么实现QQ的头像 上线是亮的下线是灰色的效果 是用2套图片吗 ? 如题!请教 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 我就知道CCS中图像处理中滤镜可以做到一张图片出两种效果。 很简单,GDI+的色彩变换能实现 void MakeBlackAndwhite(CImage* image){ if (image->IsNull()) return; if (!image->IsIndexed()) { //直接修改像素颜色 COLORREF pixel; int maxY = image->GetHeight(), maxX = image->GetWidth(); byte r,g,b,avg; for (int x=0; x<maxX; x++) { for (int y=0; y<maxY; y++) { pixel = image->GetPixel(x,y); r = GetRValue(pixel); g = GetGValue(pixel); b = GetBValue(pixel); avg = (int)((r + g + b)/3); image->SetPixelRGB(x,y,avg,avg,avg); } } } else { // 获取并修改颜色表 int MaxColors = image->GetMaxColorTableEntries(); RGBQUAD* ColorTable; ColorTable = new RGBQUAD[MaxColors]; image->GetColorTable(0,MaxColors,ColorTable); for (int i=0; i<MaxColors; i++) { int avg = (ColorTable[i].rgbBlue + ColorTable[i].rgbGreen + ColorTable[i].rgbRed)/3; ColorTable[i].rgbBlue = avg; ColorTable[i].rgbGreen = avg; ColorTable[i].rgbRed = avg; } image->SetColorTable(0,MaxColors,ColorTable); delete[] ColorTable; }}我找到答案了,用一套图片就行了使用CImage来实现 static的用法 如何更改另一窗口中的 Edit 控件中的内容? 如何提取出一个未知dll中的所有出口函数,如果能提取出参数更好! VC excel自动调整列宽的设置不保存的问题? 急!如何编程禁用和启用网卡 在VC里怎么用vector 呢? 怎样得到系统中有新的应用程序或进程启动的消息呢? 奇怪!看看下面这个COM问题! 一个关于菜单的超级难的问题!!!!!!!!!!!!!!!!!!!! 有谁知道如果要打包Crystal report需要哪些文件以及如何注册这些文件? mfc access数据库连接 有个问题
{
if (image->IsNull())
return; if (!image->IsIndexed())
{
//直接修改像素颜色
COLORREF pixel;
int maxY = image->GetHeight(), maxX = image->GetWidth();
byte r,g,b,avg;
for (int x=0; x<maxX; x++)
{
for (int y=0; y<maxY; y++)
{
pixel = image->GetPixel(x,y);
r = GetRValue(pixel);
g = GetGValue(pixel);
b = GetBValue(pixel);
avg = (int)((r + g + b)/3);
image->SetPixelRGB(x,y,avg,avg,avg);
}
}
}
else
{
// 获取并修改颜色表
int MaxColors = image->GetMaxColorTableEntries();
RGBQUAD* ColorTable;
ColorTable = new RGBQUAD[MaxColors];
image->GetColorTable(0,MaxColors,ColorTable);
for (int i=0; i<MaxColors; i++)
{
int avg = (ColorTable[i].rgbBlue + ColorTable[i].rgbGreen + ColorTable[i].rgbRed)/3;
ColorTable[i].rgbBlue = avg;
ColorTable[i].rgbGreen = avg;
ColorTable[i].rgbRed = avg;
}
image->SetColorTable(0,MaxColors,ColorTable);
delete[] ColorTable;
}
}我找到答案了,用一套图片就行了
使用CImage来实现