|
|||||||
| Qwt Questions related to Qwt - Qt widgets for technical applications. |
![]() |
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hello! Friends,
I am working with Qt4.3 on WinXp. I have a application with qwtplot to draw curves of my application. Now i want to save/convert the drawn qwtplot into a.jpg or. jpeg or .bitmap or any format and save it to the same directory which i can afterwards use to analyse few things. Can anyone please suggest me the right path to do the needful. Thanks in Advance ![]() |
|
#2
|
|||
|
|||
|
a) Use QwtPlot:
rint(QPaintDevice&, ...);b) Use QPixmap::grabWidget I always recommend a) because the plot is rendered to the geometry of your target and with SVG or PDF you can have a scalable vector graphics format. F.e. you can zoom in a PDF viewer later ( limited by the fact, that Qwt still uses integers, because of Qt3 compatibility ). The bode example shows how to do it. With b) you get a screenshot of your window. Uwe |
| The following user says thank you to Uwe for this useful post: | ||
Krish (19th March 2008) | ||
|
#3
|
|||
|
|||
|
Hello! Uwe,
Thanks very much for informing me that. I got the required result with step a). But i also want to save the screenshot of my widget, for which i tried step b) but not working ![]() Here is what i tried: - QPixmap screen; screen.grabWidget(this); screen.save("screenshot","JPG",-1); Can you please suggest where am i going wrong? Thanks in advance. Last edited by Krish; 19th March 2008 at 10:38. |
|
#4
|
|||
|
|||
|
grabWidget() is a static method.
|
| The following user says thank you to wysota for this useful post: | ||
Krish (19th March 2008) | ||
|
#5
|
|||
|
|||
|
Quote:
QPixmap screen; screen = QPixmap::grabWidget(this); screen.save("screenshot","JPG",-1); Thadeu |
|
#6
|
|||
|
|||
|
Hey! Thanks Thadeu for replying, but i have already solved the problem.
Best Regards. ![]() |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|