I want to rotate a particular image that is drawn in QRectf this my code ,I DO GET THE IMAGE but when i try to rotate it gets rotate outside the rectangle.
help me out guys.
Printable View
I want to rotate a particular image that is drawn in QRectf this my code ,I DO GET THE IMAGE but when i try to rotate it gets rotate outside the rectangle.
help me out guys.
QPainter::rotate() used (0,0) as the rotation anchor. If you want to rotate around the center of the rectange than you have to first translate into the center, then rotate.
resetTransform() when you're done.
Alternatively you can prepare a QTransform object that contains those two transformations, set it before drawing the image.
Cheers,
_
thanks i got that point of translating to center ,
but i want that rotated image to fit in the Rectangle size ...ne idea??