cairo

Putting .SVG images into tkinter Frame

我与影子孤独终老i 提交于 2020-12-23 01:44:31
问题 I have been trying to put the image from https://betacssjs.chesscomfiles.com/bundles/web/favicons/safari-pinned-tab.f387b3f2.svg into a Tkinter frame. I found from the post here that it is possible with the help from rsvg and cairo. I was using python 3.6 on Windows 10. I got rsvg from here and cairo from here and then extracted the folders to the 'C:\Users...\site_packages' folder. They import fine but I cannot figure out how to use them. I tried using the code: import tkinter as tk main=tk

Module 'cairo' has no 'ImageSurface' member

孤人 提交于 2020-12-15 06:37:43
问题 When I am trying to execute this example, I am getting problem messages like: Module 'cairo' has no 'FORMAT_ARGB32' member Module 'cairo' has no 'ImageSurface' member Module 'cairo' has no 'Context' member Module 'cairo' has no 'LinearGradient' member What is the problem here? I am using python version '3.9.0' and pycairo version '1.20.0' 来源: https://stackoverflow.com/questions/64886845/module-cairo-has-no-imagesurface-member

Why do Greek letters fail to render in R's (v4) PDF output?

☆樱花仙子☆ 提交于 2020-12-12 02:44:53
问题 I am trying to export a simple plot to PDF from R, with a Greek letter, like this: cairo_pdf("test.pdf") barplot(1, main = "\u03C1") dev.off() I am on an OpenSUSE LEAP 15.1 system with R 3.5 preinstalled - this works fine. So the necessary fonts must be installed. However, in R 4.0.3 (which I compiled myself), the same command yields a box instead of the Greek letter: (Interestingly, copy-and-pasting this box inserts the correct Greek letter.) Is this a fundamental difference between R v3 and

Why do Greek letters fail to render in R's (v4) PDF output?

好久不见. 提交于 2020-12-12 02:44:51
问题 I am trying to export a simple plot to PDF from R, with a Greek letter, like this: cairo_pdf("test.pdf") barplot(1, main = "\u03C1") dev.off() I am on an OpenSUSE LEAP 15.1 system with R 3.5 preinstalled - this works fine. So the necessary fonts must be installed. However, in R 4.0.3 (which I compiled myself), the same command yields a box instead of the Greek letter: (Interestingly, copy-and-pasting this box inserts the correct Greek letter.) Is this a fundamental difference between R v3 and

[翻译]PyCairo指南--变换

折月煮酒 提交于 2020-11-18 20:10:43
变换 PyCairo 图形学编程指南的这个部分,我们将讨论变换。 一个仿射变换 由0个或者多个线性变换(旋转,放缩或切变)和平移(移位)组成。一些线性变换可以被结合起来放进一个单一的矩阵中。一个 旋转 是将一个精确的对象沿着一个固定的点做移动的变换。一个 放缩 是将对象进行放大或缩小的变换。放缩系数在所有方向上都是一致的。一个 平移 ,是在一个特定的方向上,将每一个点都移动固定的距离的变换。一个切变是一个将一个对象正交的移动向给定的轴,同时保持轴某一侧的值比另一侧更大的变换。 来源: (wikipedia.org, freedictionary.com) 平移 下面的例子描述了一个简单的平移。 def on_draw(self, wdith, cr): cr.set_source_rgb(0.2, 0.3, 0.8) cr.rectangle(10, 10, 60, 60) cr.fill() cr.translate(30, 30) cr.set_source_rgb(0.8, 0.3, 0.2) cr.rectangle(0, 0, 60, 60) cr.fill() cr.translate(60, 60) cr.set_source_rgb(0.8, 0.8, 0.2) cr.rectangle(0, 0, 60, 60) cr.fill() cr.translate(70

VBA基础七:字典

帅比萌擦擦* 提交于 2020-10-03 13:31:21
借花献佛: 一、定义字典 Set d = CreateObject("Scripting.Dictionary") 二、呼之即来,挥之即去 d("张三“)=1 '相当于给字典赋值,张三过来(没有就生成)拿个1站一边去 d("李四”)=2 '相当于给字典赋值,李四过来(没有就生成)拿个2站一边去 d("李四”)=3 '相当于改变值,字典中已经有李四了,李四跑过来,丢下2换个3站一边去 注:这时字典中有两个人的存在,张三=1 和 李四=3,相当于实现了去重复的功能 s=d("张三") 's=1 即叫了声张三,张三就告诉你他拿的是1 s=d("李四") 's=3 即叫了声李四,李四就告诉你他拿的是3 s=d("麻子") 's="" 没有找到麻子怎么办呢,字典里就自动生成一个麻子d("麻子") =“”,告诉你他手上是空的 注:这时字典中有三个人的存在,张三=1 ; 李四=3;麻子=“” 三、将字典里的东西变成数组 arr= d.Keys '把名字的集合按先来后到的原则放到一维数组里 arr(0)=“张三” ; arr(1)=“李四” ; arr(2)=“麻子” arr1=d.Items '把名字对应的值的集合按先来后到的原则放到一维数组里 arr1(0)=“1” ; arr1(1)=“3” ; arr1(2)=“” 四、查找字典中有没有这个人 s=d.Exists(“张三”) 's

Windows 常用设置

本秂侑毒 提交于 2020-08-11 07:21:04
Windows 卸载UWP应用 卸载命令【管理员身份运行PowerShell】 有部分应用无法使用这个方式卸载,所以能通过这种方式卸载的应用,理论上都不会对系统造成影响 闹钟 get-appxpackage *Microsoft.WindowsAlarms* | remove-appxpackage 相机 get-appxpackage *Microsoft.WindowsCamera* | remove-appxpackage Groove Music get-appxpackage *Microsoft.ZuneMusic* | remove-appxpackage Maps get-appxpackage *Microsoft.WindowsMaps* | remove-appxpackage 照片 get-appxpackage *Microsoft.Windows.Photos* | remove-appxpackage 人脉 get-appxpackage *Microsoft.People* | remove-appxpackage Firefox 修改渲染 gfx.content.azure.backends : direct2d1.1,cairo,skia 来源: oschina 链接: https://my.oschina.net/u/3135584/blog