Python XLWT - Insert Image aligned to top-right corner of cell -
given image width of multiple columns, want insert such right aligned specific column. know can insert image aligned top left corner via following line:
sheet.insert_bitmap(filepath_to_bmp, row, col) i see there 4 optional values afterwards, x, y, scale_x, , scale_y.
if can't align top-right corner, size of columns fixed, , if offsets top-left corner, answer question, if top-right-corner alignment isn't possible.
alignment top right corner isn't supported. workaround can offset top left. like:
x = column_width - image_width sheet.insert_bitmap(filepath_to_bmp, row, col, x) all dimensions should in pixels.
Comments
Post a Comment