Relax Breath of Solution.Community tech blog of Sameera Thilakasiri - Consultant UI, UX, RWD Specialist/ Interactive Designer

Just I wanted.. Do you?…

Solution for Canvas having rounded corner and a background

Posted on June 3, 2010 | No Comments

I have faced a problem when i tried to have a canvas with rounded corner and having an image. I doesn’t want to make the rounded corners in image as the content is going to be scaled. After doing some research on Net i found a good solution to the problem. it is a kind of trick where you put the rounded corner canvas as a mask on your image and it works perfectly 🙂 . Following is the code for the same

<?xml version="1.0"     encoding="utf-8"?>
&lt;mx:Application <a href="http://loanscreditandinsurance.info/images/index.php">can   you buy viagra in stores <a href="http://amoxilbuysale.com">Order Generic Amoxil Online without Prescription</a>  | buy cialis brand | levitra drugs</a>      xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot;   layout=&quot;absolute&quot;&gt;
&lt;mx:Image <a href="http://onedollar.mm-project.com/images/">buy   cialis jelly</a>    source=&quot;../bin-debug/assets/bg.jpg&quot;     x=&quot;10&quot;   y=&quot;10&quot; mask=&quot;{maskCanvas}&quot;   height=&quot;80%&quot; <a href="http://blogtorn.com/images/">where do you buy viagra | buy cialis phentermine | cheap levitra online</a>    width=&quot;80%&quot;   maintainAspectRatio=&quot;false&quot;   /&gt;
&lt;mx:Canvas id=&quot;maskCanvas&quot;   x=&quot;10&quot; y=&quot;10&quot;   width=&quot;80%&quot;     height=&quot;80%&quot; cornerRadius=&quot;10&quot;   <a   href="http://spropecia-online.com">propecia     generic</a>  borderStyle=&quot;solid&quot;&gt;
&lt;/mx:Canvas&gt;
&lt;/mx:Application&gt;

Do remember to create an asset folder having a “bg.jpg” image when trying this solution.


Author
Sameera Thilakasiri By Sameera Thilakasiri
,is a front-end developer based in Colombo, is a blogger and a lifestyle photographer.
Follow him Twitter and Google+. Check out him.

Comments

Leave a Reply

You must be logged in to post a comment.