By different do you mean slightly off (i.e. the wrong shade of red), or
completely wrong (i.e. black instead of red)?  I've gotten it to work but I
agree it doesn't look right.  It's not picking up the antialiasing or pixel
fitting or something.  I don't think embeded fonts are helping but i have to
do a few more tests to make sure I actually embeded the font correctly.
I'll see what else I can find.  Maybe this just won't work well enough.

Dan Freiman
nondocs <http://nondocs.blogspot.com>

On 5/10/07, Mark Ingram <[EMAIL PROTECTED]> wrote:

   Yes it was confusing that the example on Adobe LiveDocs didn't work
when plugged straight into a basic application.



Anyway, I tried the code and got it to output a bitmap of a TextField –
however – it didn't look anything like the TextInput control.

The font style and colour was different. I tried changing the background
colour but the bitmap kept outputting it with a white background




  ------------------------------

*From:* [email protected] [mailto:[EMAIL PROTECTED] *On
Behalf Of *gbkfortna
*Sent:* 09 May 2007 20:32
*To:* [email protected]
*Subject:* [flexcoders] Re: Drawing text to screen / bitmap



I was having trouble going over this and getting it to work. Would you
mind taking the example code snippets below and put them together so
it works within a small Flex application?
Thanks, It would be greatly appreciated.
Greg

--- In [email protected] <flexcoders%40yahoogroups.com>, "Alex
Harui" <[EMAIL PROTECTED]> wrote:
>
> To be clear, you can add bitmaps as children, but you cannot add them as
> children of Flex containers as their children must implement
> IUIComponent. You can add it as a child of UIComponent and add that to
> a container.
>
> ________________________________
>
> From: [email protected] <flexcoders%40yahoogroups.com> [mailto:
[email protected] <flexcoders%40yahoogroups.com>] On
> Behalf Of Daniel Freiman
> Sent: Wednesday, May 09, 2007 7:38 AM
> To: [email protected] <flexcoders%40yahoogroups.com>
> Subject: Re: [flexcoders] Drawing text to screen / bitmap
>
>
>
> You don't add bitmaps as children. Instead you draw them using the
> Graphics class.
>
> this.graphics.beginBitmapFill(bitmapData);
> this.graphics.drawRect(0,0,bitmapData.width,bitmapData.height);
>
>
>
>
> On 5/9/07, Mark Ingram <[EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]> > wrote:
>
>
>
> Hi, I have tried the following code from Adobe's site, but I
> receive the runtime error: Error #1034: Type Coercion failed: cannot
> convert flash.display::[EMAIL PROTECTED] to mx.core.IUIComponent.)
>
>
>
> var text:TextField = new TextField();
>
> text.text = "Testing!";
>
>
>
> var bitmapData:BitmapData =
> new BitmapData(80, 20);
>
> bitmapData.draw(text);
>
>
>
> var bitmap:Bitmap = new
> Bitmap(bitmapData);
>
> this.addChild(bitmap);
>
>
>
> What am I doing wrong? I called that from creationComplete in my
> application.
>
>
>
>
>
>
>
>
> ________________________________
>
>
> From: [email protected] <flexcoders%40yahoogroups.com> [mailto:
flexcoders@
> <mailto:flexcoders@> yahoogroups.com <http://yahoogroups.com> ] On
> Behalf Of Daniel Freiman
> Sent: 09 May 2007 14:45
> To: [email protected] <flexcoders%40yahoogroups.com>
> Subject: Re: [flexcoders] Drawing text to screen / bitmap
>
>
>
> The only way to render text is through flash.text.TextField, or
> StaticText. You can then draw that text into a bitmap using
> flash.display.BitmapData.draw() to draw the TextField to a bitmap.
>
> Daniel Freiman
> nondocs <http://nondocs.blogspot.com>
>
> On 5/9/07, Mark Ingram <[EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]> > wrote:
>
> Hi, is it possible to draw text to the screen or to a bitmap in
> Flex?
>

Reply via email to