Hello Ernest, this draws a rectangle with rounded boarders and a mask. I would 
like to have a circle used a a mask for an image, more like the way display 
pictures appear on whatsapp
<?xml version="1.0" encoding="utf-8"?>
<!-- 
http://blog.flexexamples.com/2008/09/09/rounding-the-corners-of-an-image-control-in-flex-using-a-mask/
 -->
<mx:Application name="Image_mask_test"
        xmlns:mx="http://www.adobe.com/2006/mxml";
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"
        initialize="init();">
 
    <mx:Script>
        <![CDATA[
            import mx.events.ResizeEvent;
 
            private var roundedMask:Sprite;
 
            private function init():void {
                roundedMask = new Sprite();
                canvas.rawChildren.addChild(roundedMask);
            }
 
            private function image_resize(evt:ResizeEvent):void {
                var w:Number = evt.currentTarget.width;
                var h:Number = evt.currentTarget.height;
                var cornerRadius:uint = 60;
                roundedMask.graphics.clear();
                roundedMask.graphics.beginFill(0xFF0000);
                roundedMask.graphics.drawRoundRect(0, 0,
                            w, h,
                            cornerRadius, cornerRadius);
                roundedMask.graphics.endFill();
                image.mask = roundedMask;
            }
        ]]>
    </mx:Script>
 
    <mx:Canvas id="canvas">
        <mx:Image id="image"
                source="http://www.helpexamples.com/flash/images/image1.jpg";
                resize="image_resize(event);">
        </mx:Image>
    </mx:Canvas>
 
</mx:Application>

 

    On Saturday, August 13, 2016 12:34 AM, "Hervé Crespel 
crespel.he...@wanadoo.fr [flexcoders]" <flexcoders@yahoogroups.com> wrote:
 

      You are right.
 
 But Flex is not dead. It is an Apache project. And still evolving. It became 
Apache in version 4.7 and is now version 4.19.
 
 
 
 Le 11/08/2016 à 02:57, Mr Nobody maverick_0...@yahoo.com [flexcoders] a écrit :
  
    The guy who said that killing flex was crime well I will say it was more 
than a crime and a pathetic one the technologies should not be shape shifted 
this way. Still there is no camparison to the pixel perfection of the 
Flash/Flex platform. JavaScript can't promise the crispness sharpness and 
clarity of Flash  platform. The killed it simply. There was a time when this 
group wasn't such quite now there's nothing like before... Alex(Flex) Haurui 
was always there... This thing itself signifys that how much devs moved on to 
other web/mobile platforms. It really disappointed Flex devs a lot... Anyways 
wish u all the best.
  On Aug 10, 2016 1:20 PM, "stinas...@yahoo.com [flexcoders]" 
<flexcoders@yahoogroups.com> wrote:
 >
 >  
 >
 > Hello guys, i am trying to create a circular mask for an image control so 
 > that the picture can be circular. Here is my code so far. 
 >
 >
 > <?xml version="1.0" encoding="utf-8"?>
 >
 > <mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml";
 >
 >   width="180"
 >
 >   height="180"
 >
 >   initialize="init();">
 >
 >
 > <mx:Script>
 >
 > <![CDATA[
 >
 > import mx.events.ResizeEvent;
 >
 >
 > private var roundedMask:Sprite;
 >
 >
 > private function init():void
 >
 > {
 >
 > roundedMask=new Sprite();
 >
 > this.rawChildren.addChild(roundedMask);
 >
 > }
 >
 >
 > private function image_resize(evt:ResizeEvent):void
 >
 > {
 >
 > roundedMask.graphics.clear();
 >
 > roundedMask.graphics.beginFill(0xFF0000);
 >
 > roundedMask.graphics.drawCircle(stage.stageWidth / 2, stage.stageHeight / 2, 
 > 90);
 >
 > roundedMask.graphics.endFill();
 >
 > image.mask=roundedMask;
 >
 > }
 >
 > ]]>
 >
 > </mx:Script>
 >
 >
 > <mx:Image id="image"
 >
 >  source="http://www.helpexamples.com/flash/images/image1.jpg";
 >
 >  resize="image_resize(event);">
 >
 > </mx:Image>
 >
 >
 > </mx:Canvas>
 >
 >  
 >
 > the image is not the way i want it. Could someone please help
 >
 >
 > 
   
 
   #yiv4039539360 #yiv4039539360 -- #yiv4039539360ygrp-mkp {border:1px solid 
#d8d8d8;font-family:Arial;margin:10px 0;padding:0 10px;}#yiv4039539360 
#yiv4039539360ygrp-mkp hr {border:1px solid #d8d8d8;}#yiv4039539360 
#yiv4039539360ygrp-mkp #yiv4039539360hd 
{color:#628c2a;font-size:85%;font-weight:700;line-height:122%;margin:10px 
0;}#yiv4039539360 #yiv4039539360ygrp-mkp #yiv4039539360ads 
{margin-bottom:10px;}#yiv4039539360 #yiv4039539360ygrp-mkp .yiv4039539360ad 
{padding:0 0;}#yiv4039539360 #yiv4039539360ygrp-mkp .yiv4039539360ad p 
{margin:0;}#yiv4039539360 #yiv4039539360ygrp-mkp .yiv4039539360ad a 
{color:#0000ff;text-decoration:none;}#yiv4039539360 #yiv4039539360ygrp-sponsor 
#yiv4039539360ygrp-lc {font-family:Arial;}#yiv4039539360 
#yiv4039539360ygrp-sponsor #yiv4039539360ygrp-lc #yiv4039539360hd {margin:10px 
0px;font-weight:700;font-size:78%;line-height:122%;}#yiv4039539360 
#yiv4039539360ygrp-sponsor #yiv4039539360ygrp-lc .yiv4039539360ad 
{margin-bottom:10px;padding:0 0;}#yiv4039539360 #yiv4039539360actions 
{font-family:Verdana;font-size:11px;padding:10px 0;}#yiv4039539360 
#yiv4039539360activity 
{background-color:#e0ecee;float:left;font-family:Verdana;font-size:10px;padding:10px;}#yiv4039539360
 #yiv4039539360activity span {font-weight:700;}#yiv4039539360 
#yiv4039539360activity span:first-child 
{text-transform:uppercase;}#yiv4039539360 #yiv4039539360activity span a 
{color:#5085b6;text-decoration:none;}#yiv4039539360 #yiv4039539360activity span 
span {color:#ff7900;}#yiv4039539360 #yiv4039539360activity span 
.yiv4039539360underline {text-decoration:underline;}#yiv4039539360 
.yiv4039539360attach 
{clear:both;display:table;font-family:Arial;font-size:12px;padding:10px 
0;width:400px;}#yiv4039539360 .yiv4039539360attach div a 
{text-decoration:none;}#yiv4039539360 .yiv4039539360attach img 
{border:none;padding-right:5px;}#yiv4039539360 .yiv4039539360attach label 
{display:block;margin-bottom:5px;}#yiv4039539360 .yiv4039539360attach label a 
{text-decoration:none;}#yiv4039539360 blockquote {margin:0 0 0 
4px;}#yiv4039539360 .yiv4039539360bold 
{font-family:Arial;font-size:13px;font-weight:700;}#yiv4039539360 
.yiv4039539360bold a {text-decoration:none;}#yiv4039539360 dd.yiv4039539360last 
p a {font-family:Verdana;font-weight:700;}#yiv4039539360 dd.yiv4039539360last p 
span {margin-right:10px;font-family:Verdana;font-weight:700;}#yiv4039539360 
dd.yiv4039539360last p span.yiv4039539360yshortcuts 
{margin-right:0;}#yiv4039539360 div.yiv4039539360attach-table div div a 
{text-decoration:none;}#yiv4039539360 div.yiv4039539360attach-table 
{width:400px;}#yiv4039539360 div.yiv4039539360file-title a, #yiv4039539360 
div.yiv4039539360file-title a:active, #yiv4039539360 
div.yiv4039539360file-title a:hover, #yiv4039539360 div.yiv4039539360file-title 
a:visited {text-decoration:none;}#yiv4039539360 div.yiv4039539360photo-title a, 
#yiv4039539360 div.yiv4039539360photo-title a:active, #yiv4039539360 
div.yiv4039539360photo-title a:hover, #yiv4039539360 
div.yiv4039539360photo-title a:visited {text-decoration:none;}#yiv4039539360 
div#yiv4039539360ygrp-mlmsg #yiv4039539360ygrp-msg p a 
span.yiv4039539360yshortcuts 
{font-family:Verdana;font-size:10px;font-weight:normal;}#yiv4039539360 
.yiv4039539360green {color:#628c2a;}#yiv4039539360 .yiv4039539360MsoNormal 
{margin:0 0 0 0;}#yiv4039539360 o {font-size:0;}#yiv4039539360 
#yiv4039539360photos div {float:left;width:72px;}#yiv4039539360 
#yiv4039539360photos div div {border:1px solid 
#666666;min-height:62px;overflow:hidden;width:62px;}#yiv4039539360 
#yiv4039539360photos div label 
{color:#666666;font-size:10px;overflow:hidden;text-align:center;white-space:nowrap;width:64px;}#yiv4039539360
 #yiv4039539360reco-category {font-size:77%;}#yiv4039539360 
#yiv4039539360reco-desc {font-size:77%;}#yiv4039539360 .yiv4039539360replbq 
{margin:4px;}#yiv4039539360 #yiv4039539360ygrp-actbar div a:first-child 
{margin-right:2px;padding-right:5px;}#yiv4039539360 #yiv4039539360ygrp-mlmsg 
{font-size:13px;font-family:Arial, helvetica, clean, sans-serif;}#yiv4039539360 
#yiv4039539360ygrp-mlmsg table {font-size:inherit;font:100%;}#yiv4039539360 
#yiv4039539360ygrp-mlmsg select, #yiv4039539360 input, #yiv4039539360 textarea 
{font:99% Arial, Helvetica, clean, sans-serif;}#yiv4039539360 
#yiv4039539360ygrp-mlmsg pre, #yiv4039539360 code {font:115% 
monospace;}#yiv4039539360 #yiv4039539360ygrp-mlmsg * 
{line-height:1.22em;}#yiv4039539360 #yiv4039539360ygrp-mlmsg #yiv4039539360logo 
{padding-bottom:10px;}#yiv4039539360 #yiv4039539360ygrp-msg p a 
{font-family:Verdana;}#yiv4039539360 #yiv4039539360ygrp-msg 
p#yiv4039539360attach-count span {color:#1E66AE;font-weight:700;}#yiv4039539360 
#yiv4039539360ygrp-reco #yiv4039539360reco-head 
{color:#ff7900;font-weight:700;}#yiv4039539360 #yiv4039539360ygrp-reco 
{margin-bottom:20px;padding:0px;}#yiv4039539360 #yiv4039539360ygrp-sponsor 
#yiv4039539360ov li a {font-size:130%;text-decoration:none;}#yiv4039539360 
#yiv4039539360ygrp-sponsor #yiv4039539360ov li 
{font-size:77%;list-style-type:square;padding:6px 0;}#yiv4039539360 
#yiv4039539360ygrp-sponsor #yiv4039539360ov ul {margin:0;padding:0 0 0 
8px;}#yiv4039539360 #yiv4039539360ygrp-text 
{font-family:Georgia;}#yiv4039539360 #yiv4039539360ygrp-text p {margin:0 0 1em 
0;}#yiv4039539360 #yiv4039539360ygrp-text tt {font-size:120%;}#yiv4039539360 
#yiv4039539360ygrp-vital ul li:last-child {border-right:none 
!important;}#yiv4039539360 

   

Reply via email to