19,469
社区成员
发帖
与我相关
我的任务
分享
Image mImg( L"System Computer.ico" );
CDC* pdc = GetDC();
ColorMatrix colorMatrix = { //设置色彩校正矩阵
0.30f, 0.30f, 0.30f, 0.00f, 0.00f,
0.59f, 0.59f, 0.59f, 0.00f, 0.00f,
0.11f, 0.11f, 0.11f, 0.00f, 0.00f,
0.00f, 0.00f, 0.00f, 0.30f, 0.00f,
0.00f, 0.00f, 0.00f, 0.00f, 1.00f };
ImageAttributes imageAtt;
imageAtt.SetColorMatrix( &colorMatrix);
Graphics gHandle( pdc->m_hDC );
INT iWidth = mImg.GetWidth();
INT iHeight = mImg.GetHeight();
gHandle.DrawImage( &mImg,640,500);
gHandle.DrawImage( &mImg, Rect( 500, 500, iWidth, iHeight), 0, 0, iWidth, iHeight, UnitPixel, &imageAtt);