Menu

#7 Option for stretch / scale images with or without aspect ratio

2.0
closed
nobody
None
2014-09-29
2014-09-28
Frank
No

I know some other report generator and they keep the aspect ratio of the image while resizing it. It would be nice to see this feature in the designer. A nice solution would be to give the user an option to choose after the image has been selected.

I've added this for me in the QtRPT:

void QtRPT::drawFields(QDomNode band, QDomElement e, int bandTop, bool draw) {...
QString imagesize_= e.attribute("imagesize"); // scale, stretch
...

if (imagesize_.toLower().compare("scale")){
pixmap.scaled(left_ - width_, top_ - height_, Qt::IgnoreAspectRatio, Qt::FastTransformation);
} else {
pixmap.scaled(left_ - width_, top_ - height_, Qt:: KeepAspectRatio, Qt::FastTransformation);
}

btw: woud you create an github project? It's more flexible. I would add some other pages sizes because I need them too as mentioned in another ticket. ;-)

Frank

Discussion

  • aliks-os

    aliks-os - 2014-09-29

    Many thanks for a reminder of it. Fixed, now possible use image in two mode: Ignore or Keep aspect ratio. Will be uploaded at next release.

     
  • aliks-os

    aliks-os - 2014-09-29
    • status: open --> closed
     

Log in to post a comment.