我是Qt中的新成員。我正在研究圖像的旋轉。在我的情況下,旋轉工作正常,但旋轉後出現黑色填充背景。我想刪除或隱藏黑色背景。如何在圖像旋轉後移除黑色填充背景
我正在使用MAC。所以我正在使用「Imageevent」applescript。我的腳本是這樣的:告訴應用程序「圖像事件」。
launch
set this_image to open this_file
rotate this_image to angle 270
save this_image with icon
close this_image
end tell
除了這個劇本我自己也嘗試這個Qt代碼爲圖像旋轉:
void MyWidget::rotateLabel()
{
QPixmap pixmap(*my_label->pixmap());
QMatrix rm;
rm.rotate(90);
pixmap = pixmap.transformed(rm);
my_label->setPixmap(pixmap);
}
你怎麼旋轉?發佈一些代碼 – UmNyobe 2013-05-07 11:20:19
這不是Qt問題,而是applescript的問題。 – Trompa 2013-05-07 14:22:21
你好Trompa,我已經嘗試了Qt代碼以及我編輯過的問題。請通過它告訴我,如果你對我有任何建議。\ – Ashish 2013-05-08 04:42:43