rishiraj
19th January 2009, 12:36
Hi,
I can't figure out how to rotate a picture which is set on top of a Label(in Qt 4.4.3)
In Qt 3.3,I did it this way---
int count=0;
void pic_dis::rotate()
{
count++;
QPixmap pm1 = QPixmap(fileName); //fileName is the complete path to the
//picture
//which I need to rotate
QMatrix m1 ;
m1.rotate( (90*count)%360 );
if(count%2==1)
{
m1.scale((double)420/pm1.width(),
(double)750/pm1.height());
}
else
m1.scale((double)750/pm1.width(),
(double)420/pm1.height());
pm1 = pm1.xForm(m1);
pic_display->setPixmap(pm1);
}
xForm isn't available in Qt 4.4.3.
Please suggest on what changes I should make in the code to make it work in Qt 4.4.3.
Thanks for your time.
I can't figure out how to rotate a picture which is set on top of a Label(in Qt 4.4.3)
In Qt 3.3,I did it this way---
int count=0;
void pic_dis::rotate()
{
count++;
QPixmap pm1 = QPixmap(fileName); //fileName is the complete path to the
//picture
//which I need to rotate
QMatrix m1 ;
m1.rotate( (90*count)%360 );
if(count%2==1)
{
m1.scale((double)420/pm1.width(),
(double)750/pm1.height());
}
else
m1.scale((double)750/pm1.width(),
(double)420/pm1.height());
pm1 = pm1.xForm(m1);
pic_display->setPixmap(pm1);
}
xForm isn't available in Qt 4.4.3.
Please suggest on what changes I should make in the code to make it work in Qt 4.4.3.
Thanks for your time.