QImage img(":/images/images/A.png");
for (int row = 0; row < img.height(); ++row)
{
for (int col = 0; col < img.width(); ++col)
{
QColor c = img.pixelColor(col, row);
if (c.alpha() == 0)
{
std::cout << " ";
}
else
{
if (c.red() == 255)
{
std::cout << "#";
}
else
{
std::cout << "|";
}
}
}
std::cout << std::endl;
}
Qt读取qrc中png图像的信息
最新推荐文章于 2024-09-07 10:00:00 发布