在不保存到文件的情况下捕获pygraphviz图像渲染? [英] Capture pygraphviz image rendering without saving to a file?
本文介绍了在不保存到文件的情况下捕获pygraphviz图像渲染?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
pygraphviz是否允许您将图像渲染为变量?我想通过网页提供动态图像,而不必将图形呈现到磁盘上.
Does pygraphviz allow for you to render an image to a variable? I would like to serve up dynamic images via a webpage without having to render the graphs to disk.
推荐答案
根据 path 参数(或设置为 None
)的情况下调用AGraph对象的 draw
方法,则nofollow noreferrer>到源代码),它将返回数据,而不是保存到文件中.不要忘记指定 format
参数.
According to the sources if you call draw
method of AGraph object while path
parameter is omitted (or set to None
) it will return data instead saving to a file. Do not forget to specify format
paramater.
这篇关于在不保存到文件的情况下捕获pygraphviz图像渲染?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文