• 10658阅读
  • 3回复

求助QT下图片的移动如何实现? [复制链接]

上一主题 下一主题
离线bestfox
 
只看楼主 倒序阅读 楼主  发表于: 2008-04-08
— 本帖被 XChinux 执行加亮操作(2008-07-18) —
关键词: 图片界面
1。如何将显示的图片在规定屏幕内进行移动?
2。如有一个220*220的图片,如何显示该图的任意一部分,如50×50大小。
实现这些功能应该调用什么类?
有什么建议和参考资料希望各位大侠赐教!谢谢!
[ 此贴被XChinux在2008-07-18 08:00重新编辑 ]
离线captain08
只看该作者 1楼 发表于: 2008-04-08
多看QT自带的例子。
图片移动看例子中的Drag and Drop
离线jamesman_xu
只看该作者 2楼 发表于: 2010-11-21
你说的这个功能qtdemo中有相关的例程,一看便知
离线roywillow

只看该作者 3楼 发表于: 2010-11-21
第二个问题
QImage QImage::copy ( const QRect & rectangle = QRect() ) const
Returns a sub-area of the image as a new image.
The returned image is copied from the position (rectangle.x(), rectangle.y()) in this image, and will always have the size of the given rectangle.
In areas beyond this image, pixels are set to 0. For 32-bit RGB images, this means black; for 32-bit ARGB images, this means transparent black; for 8-bit images, this means the color with index 0 in the color table which can be anything; for 1-bit images, this means Qt::color0.
If the given rectangle is a null rectangle the entire image is copied.
See also QImage().

QImage QImage::copy ( int x, int y, int width, int height ) const
This is an overloaded function.
The returned image is copied from the position (x, y) in this image, and will always have the given width and height. In areas beyond this image, pixels are set to 0.

直接搬的助手原话
专业维修核潜艇,回收二手航母、二手航天飞机,大修核反应堆,拆洗导弹发动机更换机油,无人侦察机手动挡改自动,航天飞机保养换三滤,飞碟外太空年检 ,各型号导弹加装迎宾踏板,高空作业擦洗卫星表面除尘、打蜡及抛光,东风全系列巡航导弹。并提供原子对撞机。量大从优,有正规发票。
快速回复
限100 字节
 
上一个 下一个