开发者

Add the text dynamically on Image in flex

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜