开发者

Add the text dynamically on Image in flex

开发者 https://www.devze.com 2023-02-25 16:30 出处:网络
I want to develop an application in flex 3 in开发者_如何转开发 that application I can add the text dynamically on the image. Also I can able to rotate the text, change the size of text container. Can

I want to develop an application in flex 3 in开发者_如何转开发 that application I can add the text dynamically on the image. Also I can able to rotate the text, change the size of text container. Can anyone help me for that?


Pretty easy to do something like this, assuming you know the width/height of your images, you could do something like this:

<mx:Canvas id="myImage" width="<image_width>" height="<image_height>" backgroundImage="<image>" />

Then you can add Text to the canvas:

var t:Text = new Text();
t.text = 'test';
// more stuff (x, y, rotate, etc)
myImage.addChild( t );

Voila!

0

精彩评论

暂无评论...
验证码 换一张
取 消