QImage为null,但在方法调用中有效

时间:2015-03-22 13:56:12

标签: c++ qt hook qimage

我正在尝试修补C ++应用程序中的方法调用,但某些内容无法正常工作。

我已经“成功”在运行时替换了该方法,但img格式/尺寸显示无效&结果test.png是0字节。但是,最后对原始方法的调用成功,因为我可以看到图像在GUI中变得尖锐。

QImage overrideBlitzSharpen(QImage &img, int radius)
{
    printf("Image %p: %d x %d @ %d (format %d) isNull: %s\n", &img, img.height(), img.width(), img.depth(), img.format(), img.isNull() ? "YES" : "NO");
    // example output: "Image 0x10c684be8: 0 x 0 @ 0 (format 0) isNull: YES"

    img.save("test.png", 0, 100);

    return (*originalBlitzSharpen)(img, radius);
}

文档: http://api.kde.org/kdesupport-api/kdesupport-apidocs/qimageblitz/html/classBlitz.html#a809992c7bd9627f058f60b0ab5f16d51

http://doc-snapshots.qt.io/4.8/qimage.html#isNull

建议?

0 个答案:

没有答案