• 9923阅读
  • 8回复

怎样取消QGraphicsView之前的缩放效果,使图像显示变成原始状态 [复制链接]

上一主题 下一主题
离线tan_tan_1
 
只看楼主 倒序阅读 楼主  发表于: 2011-07-16
怎样取消QGraphicsView之前的缩放效果,使图像显示变成原始状态
在线XChinux

只看该作者 1楼 发表于: 2011-07-16
你的问题不明确,没有讲清楚。你怎么操作的graphicsview,那就再对应还原回去啊。
二笔 openSUSE Vim N9 BB10 XChinux@163.com 网易博客 腾讯微博
承接C++/Qt、Qt UI界面、PHP及预算报销系统开发业务
离线tan_tan_1
只看该作者 2楼 发表于: 2011-07-16
我对QGraphicsView使用了scale,有没有像clear之类效果的函数可以取消scale产生的缩放效果
离线dbzhang800

只看该作者 3楼 发表于: 2011-07-16
引用第2楼tan_tan_1于2011-07-16 15:27发表的  :
我对QGraphicsView使用了scale,有没有像clear之类效果的函数可以取消scale产生的缩放效果


你能写个10几行或二三十行左右的完成程序来辅助说明你的问题么。
离线xubuwei
只看该作者 4楼 发表于: 2011-07-16
void QGraphicsView::setTransform ( const QTransform & matrix, bool combine = false )
Sets the view's current transformation matrix to matrix.
If combine is true, then matrix is combined with the current matrix; otherwise, matrix replaces the current matrix. combine is false by default.
The transformation matrix tranforms the scene into view coordinates. Using the default transformation, provided by the identity matrix, one pixel in the view represents one unit in the scene (e.g., a 10x10 rectangular item is drawn using 10x10 pixels in the view). If a 2x2 scaling matrix is applied, the scene will be drawn in 1:2 (e.g., a 10x10 rectangular item is then drawn using 20x20 pixels in the view).
离线tan_tan_1
只看该作者 5楼 发表于: 2011-07-17
已完成的一个解决办法,在使用了scale(x,y)之后保存这次scale时的参数值想,y,在下次scale之前调用一次scale(1/x,1/y)将图像还原为未缩放状态之后再进行下一次缩放。
离线雪一直下
只看该作者 6楼 发表于: 2011-07-21
fitinview?
离线regbbs
只看该作者 7楼 发表于: 2011-10-05
view的:
resetCachedContent ()
resetMatrix ()
resetTransform ()
离线littleboxes

只看该作者 8楼 发表于: 2012-06-17
引用第7楼regbbs于2011-10-05 19:35发表的  :
view的:
resetCachedContent ()
resetMatrix ()
resetTransform ()  

有启示啊
O(∩_∩)O谢谢
快速回复
限100 字节
 
上一个 下一个