Hi, Grigoriy,
I'm afraid I can't help you with images as implemented in Bitmap.py. The
method used is an antique, pre-dating BIFF8. If you write a file
containing such an image with xlwt, open it with Excel and save it
again, the image is converted to the BIFF8 format. There is no support
in xlwt for the new format, which is more complicated than the old one
by a few orders of magnitude. There was minimal documentation in the OOo
docs last time I looked. The docs that MS released within the last year
or so have critical chunks of data described as "reserved" (not in the
sense of "zero-fill this stuff, we might use it later" but "we use it
now, we're just not going to tell you what it is"). The chance of this
getting on my TODO list is zero ... unless someone sends impressive
quantities of coders, guns, and money :-)
Maybe there is someone out there who has fiddled with row heights, font
sizes, column widths, etc and can suggest some way around your problem.
Anyone?
Cheers,
John
> I'm afraid I can't help you with images as implemented in Bitmap.py.
A little premature :-)
> Maybe there is someone out there who has fiddled with row heights, font
> sizes, column widths, etc and can suggest some way around your problem.
> Anyone?
After some messing about, I discovered that Worksheet.col_width(col) [in
pixels] was returning a constant answer (64 pixels) :-(
After fixing this, the effect is that if you set the column width [in
256ths of the standard character width] *before* you insert the picture,
the picture will be OK. Changing the column width afterwards will
stretch or squash the picture.
This fix is now in the svn trunk. I have included
.../examples/image_chg_col_wid.py which demonstrates the effect of
increasing/decreasing the column width before/after inserting the image.
Please try it with your app and let us know the result.
TODO: Check that changing the row height works.
Cheers,
John