我是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