• 4164阅读
  • 4回复

[提问]如何直接保存Canvas的图片? [复制链接]

上一主题 下一主题
离线pangpangpang
 

只看楼主 倒序阅读 楼主  发表于: 2014-10-15
Canvas 的画笔画的图形如何直接保存?
离线rpdhunter

只看该作者 1楼 发表于: 2014-10-15
Canvas 这东西是qt3时代的了吧,现在已经被QGraphics框架代替啦,楼主看看新的吧
在线uidab

只看该作者 2楼 发表于: 2014-10-16
bool save(string filename)
Save the current canvas content into an image file filename. The saved image format is automatically decided by the filename's suffix.

Note: calling this method will force painting the whole canvas, not just the current canvas visible window.

不知道这个有没有帮助。

楼上这是QML中的,和Qt3不一样。
有时候为了工作直接获得答案,而我却失去了思考的乐趣!


飘啊飘,何时能安居!
离线pangpangpang

只看该作者 3楼 发表于: 2014-10-16
回 uidab 的帖子
uidab:bool save(string filename)
Save the current canvas content into an image file filename. The saved image format is automatically decided by the filename's suffix.
Note: calling this method will force painting the whole canvas, not just the current canvas v .. (2014-10-16 09:46) 

嗯,谢谢,这个是可以保存,不过效果不是我想要的~
离线pangpangpang

只看该作者 4楼 发表于: 2014-10-20
回 rpdhunter 的帖子
rpdhunter:Canvas 这东西是qt3时代的了吧,现在已经被QGraphics框架代替啦,楼主看看新的吧 (2014-10-15 20:39) 

Qt5里面也有
快速回复
限100 字节
 
上一个 下一个