Insert an image in a merged cell.

250 views
Skip to first unread message

Andres Quiroga

unread,
Mar 3, 2012, 7:19:05 PM3/3/12
to python...@googlegroups.com
I every body... I need help...

I'm trying to show an image into a merged cell. Then I need to adjust the columns width... In this step all runs perfectly, but my problem come when I need to adjust the row height...
If I change the row hieght, then, the image height too changes... ¿Why happends it?

this es my code...

def image():
    w = Workbook()
    ws = w.add_sheet('Image')
    ws.write_merge(0, 0, 0, 1)

    ws.col(0).width = 8 * 625
    ws.col(1).width = 8 * 625

    ws.row(0).height = 8 * 305

    ws.insert_bitmap('logo.bmp', 0, 0)

    w.save('image.xls')


And another simple question... How a can set a blue background for a cell ???

Thanks every body.... 

John Machin

unread,
Mar 5, 2012, 1:54:25 PM3/5/12
to python-excel

On Mar 4, 11:19 am, Andres Quiroga <andres.quiroga6...@gmail.com>
wrote:
> I'm trying to show an image into a merged cell. Then I need to adjust the
> columns width... In this step all runs perfectly, but my problem come when
> I need to adjust the row height...
> If I change the row hieght, then, the image height too changes... ¿Why
> happends it?

The image functionality in xlwt relies on an antique (before Excel
97-2003) record type which more-or-less works with Excel 2003 and 2007
but has (so others have reported) vanished from Excel 2010. Trying to
show an image in a merged cell only adds to the problem. All I can
suggest is that you (a) search this group for messages with "image" in
the title (b) read the source (image.py).

> And another simple question... How a can set a blue background for a cell
> ???

This is covered in the tutorial that you can obtain via http://www.python-excel.org
Reply all
Reply to author
Forward
0 new messages