当前位置: 首页 > news >正文

网络公司给别人做网站的cms是买的授权么手机网站焦点图代码

网络公司给别人做网站的cms是买的授权么,手机网站焦点图代码,sem竞价开户,下载企业微信最新版目录 一、用手搓#xff08;QPainter#xff09; 二、使用 QGraphicsView 和 QGraphicsPixmapItem 三、使用 QTransform 实现图像旋转 四、利用 OpenGL 实现旋转图像的效果有几种不同的方法#xff0c;其中常见的包括#xff1a; 手动旋转绘制#xff1a; 使用 QPaint… 目录 一、用手搓QPainter 二、使用 QGraphicsView 和 QGraphicsPixmapItem 三、使用 QTransform 实现图像旋转 四、利用 OpenGL 实现旋转图像的效果有几种不同的方法其中常见的包括 手动旋转绘制 使用 QPainter 的旋转函数手动计算旋转后的坐标并绘制图像。这种方式需要自己处理旋转后的坐标变换相对复杂一些。 使用 QGraphicsView 和 QGraphicsPixmapItem 使用 QGraphicsView 架构绘制图形对象并在 QGraphicsScene 中添加 QGraphicsPixmapItem然后通过旋转 QGraphicsPixmapItem 实现图像旋转。 使用 QTransform 使用 QTransform 类来应用变换通过旋转矩阵来对图像进行旋转然后使用 QPainter 绘制旋转后的图像。这种方法能够简化坐标变换的操作。 利用 OpenGL 利用 Qt 的 QOpenGLWidget 和 OpenGL 的旋转操作在 OpenGL 上下文中进行图像的绘制和旋转。这种方法适用于需要更高级别的图形操作和性能要求较高的场景。 每种方法都有其特点和适用场景选择其中一种取决于你的需求和熟悉程度。通常情况下QTransform 是实现图像旋转最常用且较为简便的方式。 一、用手搓QPainter 创建绘图设备QPainter 首先需要创建一个 QPainter 对象用于执行绘图操作。 设置绘图参数 在进行绘图之前可以通过 QPainter 的函数设置渲染参数如反锯齿等。 加载图像 使用 QPixmap 加载需要绘制的图像。 设置绘图变换 使用 QPainter 的变换函数例如 translate、rotate 等将绘图坐标系转换到图像的中心并按需求进行旋转。 绘制图像 使用 QPainter 的 drawPixmap 函数在指定的位置绘制图像。 重置绘图变换可选 如果在绘制其他内容之前需要恢复坐标系变换则可以使用 QPainter 的 resetTransform 函数重置坐标系。 完成绘图 绘图完成后程序会自动将绘图设备的内容显示到窗口上或者在需要时手动调用 update 函数触发窗口的重绘。 ​手搓代码https://download.csdn.net/download/qq_43445867/88562187 二、使用 QGraphicsView 和 QGraphicsPixmapItem 1、创建一个 QGraphicsScene 对象。然后加载图像到 QPixmap 中 2、创建 QGraphicsPixmapItem 对象并将图像加载到这个 QGraphicsPixmapItem 中。 3、分别使用 setPos() 和 setRotation() 函数设置图像的位置和旋转角度。 4、将 QGraphicsPixmapItem 添加到 QGraphicsScene 中 5、创建一个 QGraphicsView 对象并将 QGraphicsScene 设置为 QGraphicsView 的场景最终显示了这个 QGraphicsView。 6、通过修改 setPos() 和 setRotation() 函数中的参数可以设置图像的位置和旋转角度。这种方法相比手动绘制更简单并且使用 QGraphicsView 和 QGraphicsPixmapItem 更方便地进行图像的操作和显示。 7、创建一个定时器 QTimer并将其连接到一个 Lambda 函数Lambda 函数中每次定时器超时时都会更新图像的旋转角度。在每个超时事件中图像的旋转角度增加 1 度并通过 setRotation() 函数应用于 QGraphicsPixmapItem从而使图像持续旋转。然后使用 timer.start() 启动定时器并设定每 30 毫秒更新一次旋转角度 #include QApplication #include QGraphicsScene #include QGraphicsView #include QGraphicsPixmapItem #include QPixmap #include QTimer ​ int main(int argc, char *argv[]) {QApplication app(argc, argv); ​// 创建 QGraphicsSceneQGraphicsScene scene; ​// 加载图像到 QPixmapQPixmap pixmap(statI.png); ​// 创建 QGraphicsPixmapItem 并将图像加载到 QGraphicsPixmapItem 中QGraphicsPixmapItem *pixmapItem new QGraphicsPixmapItem(pixmap); ​// 设置图像的旋转中心点为图像中心pixmapItem-setTransformOriginPoint(pixmap.width() / 2, pixmap.height() / 2); ​// 将 QGraphicsPixmapItem 添加到 QGraphicsScene 中scene.addItem(pixmapItem); ​// 创建 QGraphicsView并将 QGraphicsScene 设置为它的场景QGraphicsView view(scene); ​// 显示 QGraphicsViewview.show(); ​// 创建定时器并连接到槽函数以持续更新旋转角度QTimer timer;QObject::connect(timer, QTimer::timeout, []() {static qreal rotationAngle 0.0;rotationAngle 1.0; // 每次增加旋转角度 ​// 将旋转角度应用于 QGraphicsPixmapItempixmapItem-setRotation(rotationAngle);});timer.start(30); // 每 30 毫秒更新一次旋转角度 ​return app.exec(); } 三、使用 QTransform 实现图像旋转 使用 Qt 提供的图形组件和定时器来实现图像的加载和旋转通过设置合适的中心点以及应用 QTransform 进行变换操作达到了让图像围绕自身中心点旋转的效果。 // 创建 QTransform 对象并应用旋转变换QTransform transform;transform.translate(pixmap.width() / 2, pitransform.rotate(rotationAngle); // 绕中心点旋转transform.translate(-pixmap.width() / 2, -// 将变换应用于 QGraphicsPixmapItempixmapItem-setTransform(transform); 通过使用 QGraphicsScene、QGraphicsView 和 QGraphicsPixmapItem 这些 Qt 图形组件来显示图像并使用 QTimer 定时器来控制图像的旋转。 加载图像 使用 QPixmap 加载图片并将其放置在 QGraphicsPixmapItem 中然后将该项添加到 QGraphicsScene 中最终显示在 QGraphicsView 中。 设置中心点 在 QGraphicsPixmapItem 中使用 setTransformOriginPoint() 将图像的中心点设置为图像的中心。 定时旋转 创建 QTimer 定时器每当定时器超时时更新旋转角度。在超时槽函数中使用 QTransform 进行变换处理。首先移动图像的原点到中心点然后进行旋转最后再将原点移回原位置。这样就实现了图像围绕自身中心点持续旋转的效果。 显示图像 将 QGraphicsView 显示出来图像会根据定时器的触发事件在固定时间间隔内持续旋转显示。 #include QApplication #include QGraphicsScene #include QGraphicsView #include QGraphicsPixmapItem #include QPixmap #include QTransform #include QTimerint main(int argc, char *argv[]) {QApplication app(argc, argv);// 创建 QGraphicsSceneQGraphicsScene scene;// 加载图像到 QPixmapQPixmap pixmap(:/path/to/your/image.png);// 创建 QGraphicsPixmapItem 并将图像加载到 QGraphicsPixmapItem 中QGraphicsPixmapItem *pixmapItem new QGraphicsPixmapItem(pixmap);// 设置图像的中心点为原点pixmapItem-setTransformOriginPoint(pixmap.width() / 2, pixmap.height() / 2);// 将 QGraphicsPixmapItem 添加到 QGraphicsScene 中scene.addItem(pixmapItem);// 创建 QGraphicsView并将 QGraphicsScene 设置为它的场景QGraphicsView view(scene);// 显示 QGraphicsViewview.show();// 创建定时器并连接到槽函数以持续更新旋转角度QTimer timer;QObject::connect(timer, QTimer::timeout, []() {static qreal rotationAngle 0.0;rotationAngle 1.0; // 每次增加旋转角度// 创建 QTransform 对象并应用旋转变换QTransform transform;transform.translate(pixmap.width() / 2, pixmap.height() / 2); // 将原点移动到中心transform.rotate(rotationAngle); // 绕中心点旋转transform.translate(-pixmap.width() / 2, -pixmap.height() / 2); // 将原点移回原位// 将变换应用于 QGraphicsPixmapItempixmapItem-setTransform(transform);});timer.start(30); // 每 30 毫秒更新一次旋转角度return app.exec(); } 四、利用 OpenGL 待研究
http://www.hkea.cn/news/14384586/

相关文章:

  • 爱做网站免费版东莞高埗网站建设
  • 网站 例一级a做爰片免播放器网站
  • 鄂州做网站的公司个人主页介绍文案
  • 网站建设和运维单位责任网站未备案会怎么样
  • 网站飘动国内做网站的公司有哪些
  • 网站销售系统怎么做石家庄模板建站代理
  • 梧州seo深圳网页设计公司搜行者seo
  • 网站被百度惩罚怎么办自己搭建网站怎么搭建
  • 做国内贸易的网站江都微信网站建设
  • .asp 网站中学生网站源码
  • 专业建设网站外包做视频网站需要什么证件
  • 保定免费网站建站模板广东民航机场建设有限公司网站
  • 网站怎么才能吸引人百度怎样可以搜到自己的网站
  • vs做网站开发吗北京网站建设 shwl
  • 网站集约化建设规范商务网站建设简答题及答案
  • 公众出行服务网站建设wordpress取自定义字段
  • 张家口住房和城乡建设厅网站廊坊哪里做网站
  • 网站开发维护计入什么费用软件开发包含网站开发吗
  • 网站主页 优帮云传奇网站建设
  • 网站 中文版与英文版的后台有什么不同网站开发和设计实训
  • 替人做赌彩网站被判刑网站开发公司怎么查
  • 注册了网站之后怎么设计做网站都要掌握什么软件
  • 免费做网站空间wordpress手机端适配
  • 怎么建设QQ网站电子商务网站建设课程性质
  • 中企动力做的网站被百度屏蔽长沙如何优化排名
  • 寿光专业做网站百色建设厅网站
  • 做珠宝首饰网站深圳网站定制公司
  • 郑州做音响网站的公司把网站扒下来以后怎么做
  • 怎么让网站页面自适应利用淘宝联盟做网站
  • 网站的类型和特色虚拟展馆官方网站建设