我在嘗試將圖像大小調整爲120X240。QImage :: scaleHeight轉換模式返回NULL圖像
image = image.scaledToHeight(120);
image = image.scaledToWidth(240);
對於具有尺寸837x630,得到錯誤的一些圖片,
QImage::scaleHeight: Image is a null image
QImage::scaleWidth: Image is a null image
其中具有幾乎相同的尺寸有些圖像scalling正確(837X 642) 什麼是對那些errors..Some的原因圖像正確縮放,有些不是......爲什麼?
我們可以看看你是如何初始化'image'的? – Shoe
QString lPath =(QString)GPathAlphabets.c_str(); lPath.append(「/」)。append(pAlphabetFilePath); QImage image(lPath); – user3167959