-2

根据主题,如何将变量的值添加到图片中?

我有一个图像,我想在其中添加一个变量的值,最好是在之前和/或之后添加一个词。

问题的主题可以从 Jython/Python 知识中得到回答,因为它们有时以相同的方式工作。

4

1 回答 1

1
custom_text = "foo bar"

# addText(picture, xpos, ypos, text)
# add text "foo bar" to custom_picture, starting at (15, 50)
addText(custom_picture, 15, 50, custom_text)

# add text "kung-foo bar" to custom_picture2, starting at (40, 20)
addText(custom_picture2, 40, 20, "kung-" + custom_text)

new_custom_text = "kung-" + custom_text
# add text "kung-foo bar" to new_custom_picture, starting at (10, 30)
addText(new_custom_picture, 10, 30, new_custom_text)
于 2015-05-16T20:40:14.860 回答