将图像插入python应用程序

时间:2017-03-19 05:07:17

标签: python

我需要帮助将图像插入到我的python应用程序中。 我需要一些代码,它实际上将图片显示在我运行程序时打开的窗口上,并允许我将它放在屏幕上的任何地方(我猜测坐标)。

请不要说这个问题不够具体。如果你能很好地回答我的问题,真的很感激。谢谢;)

1 个答案:

答案 0 :(得分:1)

看到你正在使用codeskulptor,你应该在它的documentation的相关页面上看到如何做到这一点: 基本上,您需要先加载图像:

image = simplegui.load_image('<url>')

然后一旦完成,您就可以绘制图像:

canvas.draw_image(image, center_source, width_height_source, center_dest, width_height_dest[, rotation])