Qt-Paint系统
来源:互联网 发布:浙江师范行知学院 编辑:程序博客网 时间:2024/06/05 05:47
Qt里面,要想画图,只有把画图的过程放入paintEvent()
方法中,每次窗口变化时会回调paintEvent()
方法
Paint events are sent to widgets that need to update themselves, for
instance when part of a widget is exposed because a covering widget was
moved.
QPainter
The QPainter class performs low-level painting on widgets and other paint devices.
QPainter
类对象作用于继承QPaintDevice
类的对象
QPaintDevice
QPainter对象可以在QPaintDevice上进行绘画操作
常用的QPaintDevice
子类有QWidget, QPixmap, QImage
示例
//画图并保存为图片void SomeWidget::painterEvent(){ QImage image(50, 50, QImage::Format_RGB32); QPainter painter; painter.begin(&image); //draw something image.save("filename.jpg", "JPEG");}
QPaintEngine
The QPaintEngine class provides an abstract definition of how QPainter draws to a given device on a given platform.
QPaintEngine 不直接提供给开发人员使用,提供接口,供QPainter往不同的device上绘制图形。
Qt-Paint系统
参考链接
Qt的paint系统主要是基于QPainter, QPaintDevice & QPaintEngine
QPainter 用于画图操作
QPaintDevice 是一个二维的抽象空间,QPainter 可以在上面画图,QPaintEngine 为其提供了painter画图的相关接口
QPaintEngine 被用于QPainter 和 QPaintDevice 内部,对外透明,除非程序员创建自己的device.
- QT的Paint 系统
- QT的Paint 系统
- QT的Paint 系统
- QT的Paint 系统
- QT的Paint 系统
- QT的Paint 系统
- QT的Paint 系统
- Qt-Paint系统
- Qt 绘画系统(The Paint System)
- QT绘图系统(The Paint System)
- Qt绘制系统(Paint System)
- QT Paint System
- Qt Paint System
- Qt paint system
- QT Paint System (转)
- 关于QT的Layout和Paint
- Using Ogre paint Widget of QT
- qt 委托 paint() 显示数据
- 学习java核心卷1 前3章
- 001_LeetCode_1 Two Sum 题解
- webstorm开发Cordova App
- java使用SAX接口解析xml文件
- C++中的数据类型转换运算符
- Qt-Paint系统
- HDU 4474 Yet Another Multiple Problem
- bzoj 1899: [Zjoi2004]Lunch 午餐
- 怎么把图片转换成BMP格式
- 虽然微不足道但是很有用的JAVA基础—数组
- [BZOJ]1899: [Zjoi2004]Lunch 午餐 DP
- STL库中的stack和queue及其模拟实现
- springmvc学习笔记(19)-RESTful支持
- 类加载