美文网首页
VC++中png通道处理

VC++中png通道处理

作者: 鱼小莘 | 来源:发表于2018-09-29 00:05 被阅读0次

请看以下代码

if (this->isPNG)
    for (int i = 0; i < this->cImage.GetWidth(); i++)
    {
        for (int j = 0; j < this->cImage.GetHeight(); j++)
        {
            unsigned char* pucColor = reinterpret_cast<unsigned char *>(this->cImage.GetPixelAddress(i, j));
            pucColor[0] = pucColor[0] * pucColor[3] / 255;
            pucColor[1] = pucColor[1] * pucColor[3] / 255;
            pucColor[2] = pucColor[2] * pucColor[3] / 255;
        }
    }

相关文章

网友评论

      本文标题:VC++中png通道处理

      本文链接:https://www.haomeiwen.com/subject/xinmoftx.html