Problems with svg

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Problems with svg

chris_flex
This post was updated on .
Hot to get an SVG smoothly scaled? What am I doing wrong?

My test - the svg and the fxg are looking exactly the same in illustrator:

<s:View xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:local="*" creationComplete="test(event)">

    <fx:Script><![CDATA[
        import spark.core.SpriteVisualElement;

        [Embed(source="test3.svg")]
        public var testSVG:Class;

        public var testFXG:SpriteVisualElement = new test3();

        private function test(e:Event):void
        {
            var m:Matrix = new Matrix();
            m.scale(4, 4);

            var s:Sprite = new testSVG();

            var bd:BitmapData = new BitmapData(200, 200, true, 0x00ffffff);
            bd.draw(s, m, null, null, null, true);
            bi1.source = bd;

            var bd2:BitmapData = new BitmapData(200, 200, true, 0x00ffffff);
            bd2.draw(testFXG, m, null, null, null, true);
            bi2.source = bd2;
        }


        ]]></fx:Script>

        <s:HGroup padding="20">
            <s:Group>
                <s:BitmapImage id="bi1" width="200" height="200" smooth="true" smoothingQuality="high" />
            </s:Group>
            <s:Group>
                <s:BitmapImage id="bi2" width="200" height="200" smooth="true" smoothingQuality="high" />
            </s:Group>
        </s:HGroup>

</s:View>

leads to ...

<http://apache-flex-users.2333346.n4.nabble.com/file/t605/test.png



--
Sent from: http://apache-flex-users.2333346.n4.nabble.com/