So, you can mix <img> tags in the htmlText of a TextArea/RichTextEditor,
but there are known issues with renderering accuracy.

 

Haven't really thought this through, but you could insert enough spaces
in the text to make room for the images and float the visible images
over those spaces.  I think there is enough APIs on TextField to be able
to pull that off.

 

You might also making a custom scrolling container based on
ScrollControlBase that won't try to apply layout to all of its children
and just trust your mix of TextFields and Images.

 

-Alex

 

________________________________

From: [email protected]
[mailto:[EMAIL PROTECTED] On Behalf Of superstella_uk
Sent: Sunday, January 21, 2007 6:30 AM
To: [email protected]
Subject: [flexcomponents] Re: Drawing Text, can it really be so
difficult?

 

Thanks to everyone for the responses. 

Reid: Im writing a chat application, which will allow the user to join
several rooms at once. The chat area will show a mixture of text,
images, and also some other controls such as buttons etc intermingled
with the text. 

At the moment, I parse all chat text and create a label from it, which
is added to the chat area. In cases where there are smileys etc, or
places where buttons need to be embedded in the text, I split the text
into two or more labels, and position them with Image or Button
controls etc.

This works ok for a few lines, but the resource requirements shoot up
enormously once you have a hundred lines of mixed text.

Also the container is very slow to scroll, presumably because its
validating the layout on the list of child controls. 

Ideally what I would like is to store the chat text in custom
structures in memory, rather than as visible components. Then when it
comes to painting the *visible* portion of the chat area, I can simply
render those myself, without the need to add them all as child Labels
etc.

Someone suggested using a bitmapped font which would allow me to do
this, at the expense of easily producing different font sizes,
anti-aliasing etc. 

Ive also thought about simply rendering an offscreen bitmap, by
producing a label, capturing its 'image' to a bitmap, and then
painting that on the offscreen. Once all the visible labels and
controls are done, I can then paint the offscreen bitmap to the
visible viewport.

Ive tried richedit also, but it doesnt suit my needs, as its a bit
limited in positioning of images which is very important for me

Thanks for any more ideas. Looks like Ive got my work cut out....

--- In [email protected]
<mailto:flexcomponents%40yahoogroups.com> , Reid Priedhorsky <[EMAIL PROTECTED]>
wrote:

> Can you elaborate on your "various reasons"? I think that our advice 
> would be much more effective if we knew why Label and TextField didn't

> work for you.
> 
> Thanks,
> 
> Reid
>

 

Reply via email to