height of htmlText containing images

The project that I’m currently working on requires loading a lot of changing data that did not follow a certain pattern. I had to wrap text on some images, so I dove right in and chose to use an XML file with CDATA and img tags.

It took me a while to realize that to know the exact height of the html formatted text that contains images you need to specify the width and height of the image in the tag. Otherwise the real height of your text would be accessible only after all the images contained in that textField are loaded.The image below illustrates an example for this case: (the darker gray column’s height is set by the text height, first one without size specified in the img tag, second one with)  

 

You can get the source files here.

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • StumbleUpon
  • bodytext
  • Reddit
  • del.icio.us
  • Google