[flexcoders] circular image in flex

3 views
Skip to first unread message

stinasius@yahoo.com [flexcoders]

unread,
Aug 10, 2016, 4:20:51 AM8/10/16
to flexc...@yahoogroups.com
 

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


__._,_.___

Posted by: stin...@yahoo.com
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (1)

Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.


.

__,_._,___

stinasius@yahoo.com [flexcoders]

unread,
Aug 10, 2016, 9:09:39 AM8/10/16
to flexc...@yahoogroups.com
 

Any help guys?

__._,_.___

Posted by: stin...@yahoo.com

Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.


.

__,_._,___

Dan Pride danielpride@yahoo.com [flexcoders]

unread,
Aug 10, 2016, 11:22:00 AM8/10/16
to flexc...@yahoogroups.com
 

The death of this technology was a crime.
Oliver Cromwell has his Ireland and Steve Jobs had his flash.

Angular2 is pretty good replacement, eventually they will add a bitmap I predict.
They will have to eventually, or a facsimile thereof

When you can't mathematically relate any pixel on the screen to any other and do so over time.
You are by definition inferior to flash as a user interface.
 



From: "stin...@yahoo.com [flexcoders]" <flexc...@yahoogroups.com>
To: flexc...@yahoogroups.com
Sent: Wednesday, August 10, 2016 1:20 AM
Subject: [flexcoders] circular image in flex

__._,_.___

Posted by: Dan Pride <danie...@yahoo.com>

Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.


.

__,_._,___

Ernest Breau ernest.breau@gmail.com [flexcoders]

unread,
Aug 10, 2016, 5:17:56 PM8/10/16
to flexc...@yahoogroups.com
 

Try this one

<?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>

___________________________________________________________________
Ernest E. Breau Jr.
Senior Coldfusion Developer 
      cell: (508) 264-9856
   email: ernest...@gmail.com
resume: http://cfengineers.com
  twitter: http://twitter.com/cfengineers
   


On Wed, Aug 10, 2016 at 9:09 AM, stin...@yahoo.com [flexcoders] <flexc...@yahoogroups.com> wrote:
 

Any help guys?


__._,_.___

Posted by: Ernest Breau <ernest...@gmail.com>

Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.


.

__,_._,___

Mr Nobody maverick_0601@yahoo.com [flexcoders]

unread,
Aug 10, 2016, 9:09:41 PM8/10/16
to flexc...@yahoogroups.com
 

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.

__._,_.___

Posted by: Mr Nobody <maveri...@yahoo.com>

Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.


.

__,_._,___

Dan Pride danielpride@yahoo.com [flexcoders]

unread,
Aug 10, 2016, 10:35:54 PM8/10/16
to flexc...@yahoogroups.com
 

Whats interesting is most people never even looked at the  motivation.
My last Flex project ran beautifully on everything.
Flex threatened to completely eliminate the differences between Mac and Windows for the user.
It threatened to kill Mac or at least cause a price reduction.
THAT'S why Steve Jobs killed flash.
and the world as usual, ran off the cliff like a herd of lemmings.


From: "Mr Nobody maveri...@yahoo.com [flexcoders]" <flexc...@yahoogroups.com>
To: flexc...@yahoogroups.com
Sent: Wednesday, August 10, 2016 5:57 PM
Subject: Re: [flexcoders] circular image in flex

__._,_.___

Posted by: Dan Pride <danie...@yahoo.com>

Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.


.

__,_._,___

Hervé Crespel crespel.herve@wanadoo.fr [flexcoders]

unread,
Aug 12, 2016, 5:34:01 PM8/12/16
to flexc...@yahoogroups.com
 

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.

__._,_.___

Posted by: =?UTF-8?Q?Herv=c3=a9_Crespel?= <crespe...@wanadoo.fr>

Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.


.

__,_._,___

amanyire arthur stinasius@yahoo.com [flexcoders]

unread,
Aug 25, 2016, 8:05:52 AM8/25/16
to flexc...@yahoogroups.com
 

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>

__._,_.___

Posted by: amanyire arthur <stin...@yahoo.com>

Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.


.

__,_._,___
Reply all
Reply to author
Forward
0 new messages