问题
I'm trying to adjust image between two cells using openpyxl. My problem is that
worksheet.add_image(image, position)
method only accepts top-left position of image.
Is there any way how to scale my image between two (top-left, bottom-right) cells?
I tried to compute dimensions using
height = sum([worksheet.row_dimensions[start_row+i].height for i in range(img_cols)])
and then setting it as
from openpyxl.drawing.image import Image
Image(image_filename, size=[width,height])
but that doesn't work either
回答1:
You will be able to do this in openpyxl 2.5 but will have create and manage your own anchor.
来源:https://stackoverflow.com/questions/43063292/openpyxl-adjust-image-between-two-cells