【问题标题】:How to create cairo surface in guile如何在 guile 中创建 cairo 曲面
【发布时间】:2023-03-22 20:05:02
【问题描述】:

我有这个代码

guile> (cairo-pdf-surface-create "foo.pdf" 100.0 100.0)
; and get this error
standard input:29:1: In procedure cairo-pdf-surface-create in expression (cairo-pdf-surface-create "foo.pdf" 100.0 ...):
standard input:29:1: Wrong type (expecting string): 100.0
ABORT: (wrong-type-arg)

当我使用字符串作为宽度和高度时

guile> (cairo-pdf-surface-create "foo.pdf" "100.0" "100.0")

Backtrace:
In standard input:
  30: 0* [cairo-pdf-surface-create "foo.pdf" {"100.0"} "100.0"]

standard input:30:1: In procedure cairo-pdf-surface-create in expression (cairo-pdf-surface-create "foo.pdf" "100.0" ...):
standard input:30:1: Wrong type (expecting real number): "100.0"

文档说:

cairo-pdf-surface-create (filename )                                [功能]
(点宽度 ) (高度单位 )
⇒ (ret )

【问题讨论】:

    标签: scheme cairo guile


    【解决方案1】:

    至少对于最新版本,试试这个:

    (cairo-pdf-surface-create 100.0 100.0 "foo.pdf")
    

    参见the source,它以(sx sy filename) 的顺序指定参数,文件名是可选的(如果未指定,则使用当前输出端口)。

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-09-23
    • 2017-11-30
    • 1970-01-01
    • 2020-03-12
    • 2021-12-06
    • 2020-01-08
    • 1970-01-01
    相关资源
    最近更新 更多