This content has been marked as final. Show 6 replies
Perhaps use absolute layout, and then adjust the coordinates of the text so it overlays the image.
Greg is right, if the Text is listed after the Image on a Canvas with coordinates overlapping in absolute positioning defined in the Application tag the overlay will "automatically" occur.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Canvas x="199" y="49" width="401" height="270">
<mx:Image x="21" y="10" width="370" height="250" source="YOURPICTUREFILE.JPG"/>
<mx:Text x="88" y="132" text="YOUR TEXT ON TOP OF PICTURE" width="225" height="49" fontSize="16" fontWeight="bold" color="#F8FAFB"/>
That is correct. But are you looking for a "watermark"?
If so, a watermark is typically "IN" the image not just "OVER" the image. The difference is in one case you send the "clean" image to Flex and display it with your text over it as explained above: point being that you send a copyable, clean image.
In the other case, server side, you filter the image to add the text to the image, pixelwise. This image is then sent to the Flex as watermarked.
lol, right I want to draw text in a image, not just "over" it. so can I do it with flex? I don't want to do it on server side.
Using bitmap data, I am sure that you can do this in Flex. BUT you would still be sending a clean copy of your image to the user's machine / cache.
I use PHP and PHP's GD lib - a graphics lib. You can do it on the fly but
I would suggest that you watermark all the images once and save in a common directory rather than watermarking each image as it is requested.
Look up the PHP GD lib: http://us3.php.net/manual/en/ref.image.php
I just want to draw a ruler ;-p