当前位置:网站首页>gtk实现图片旋转
gtk实现图片旋转
2022-08-03 21:04:00 【百口可乐__】
使用cairo库的cairo_rotate函数对绘制内容进行旋转。但是旋转是围绕原点进行的。以窗口左上角为原点,水平和垂直方向为x、y轴建立的坐标系,这并不是我们想要的效果。我想让图片在窗口中的任意位置进行旋转
我想到的办法就是将绘制的图片移动,使其中心与坐标原点重合,这样就可以实现图片围绕自身进行旋转了,但是这样在窗口中只能显示左上角的一部分旋转图像
这时候就用到cairo_translate这个函数,它的功能在我理解就是平移坐标系,在这里就相当于移动图片的位置了!将坐标系移动到窗口任何你想显示的位置
实现过程
#include <gtk/gtk.h>
#include边栏推荐
- 5 款漏洞扫描工具:实用、强力、全面(含开源)
- idea2021配置svn报错Cannot run program “svn“ (in directory “xxx“):CreateProcess error=2,系统找不到指定的文件
- 伪标签汇总
- 《富爸爸,穷爸爸》思维导图和学习笔记
- 面试官:为什么 0.1 + 0.2 == 0.300000004?
- 安全基础8 ---XSS
- C. Keshi Is Throwing a Party- Codeforces Global Round 17
- 系统运维系列 之CSV文件读取时内容中包含逗号的处理方法
- 卷起来!阿里高工携 18 位高级架构师耗时 57 天整合的 1658 页面试总结
- 有趣的opencv-记录图片二值化和相似度实现
猜你喜欢
随机推荐
华为设备配置VRRP与BFD联动实现快速切换
史兴国对谈于佳宁:从经济模式到落地应用,Web3的中国之路怎么走?
开源一夏 |如何优化线上服务器
From September 1st, my country has granted zero-tariff treatment to 98% of tax items from 16 countries including Togo
【kali-漏洞扫描】(2.1)Nessus下载安装(上)
软考系统分析师备考经验分享:论持久战
A. Color the Picture- Codeforces Round #810 (Div. 1)
Android build error: Plugin with id ‘kotlin-android‘ not found.
idea2021配置svn报错Cannot run program “svn“ (in directory “xxx“):CreateProcess error=2,系统找不到指定的文件
C. Divan and bitwise operations
leetcode 1837. The sum of the digits in the K-base representation
leetcode 136. Numbers that appear only once (XOR!!)
leetcode 072. Finding Square Roots
C. Keshi Is Throwing a Party- Codeforces Global Round 17
在树莓派上搭建属于自己的网页(4)
Cesium 修改鼠标样式
回忆三年浮沉
函数,递归以及dom简单操作
Zero trust, which has been popular for more than ten years, why can't it be implemented?
buildscript和allprojects的作用和区别是什么?









