The following program loads and displays an image. Complete the draw_border function to draw a black border around the image. Don’t change the size of the image - draw 5 black lines across the top and bottom and 5 black lines down the left and right sides of the image. Do not change the main function. import image def draw_border(pic): '''Returns an image with a black border around it''' pass #You can leave this or remove it #Your code here to draw a black border around the image def main(): '''Controls the program''' fname = "https://runestone.academy/runestone/static/instructorguide/_static/arch.jpg" img = image.Image(fname) width = img.getWidth() height = img.getHeight() win = image.ImageWin(width, height) draw_border(img) img.draw(win) main() #Run the program
3. The following
import image
def draw_border(pic):
'''Returns an image with a black border around it'''
pass #You can leave this or remove it
#Your code here to draw a black border around the image
def main():
'''Controls the program'''
fname = "https://runestone.academy/runestone/static/instructorguide/_static/arch.jpg"
img = image.Image(fname)
width = img.getWidth()
height = img.getHeight()
win = image.ImageWin(width, height)
draw_border(img)
img.draw(win)
main() #Run the program
Step by step
Solved in 2 steps