Flex의 Canvas 구성 요소 주위에 부유 효과와 같은 드롭 그림자를 어떻게 만들려면?

StackOverflow https://stackoverflow.com/questions/242363

  •  04-07-2019
  •  | 
  •  

문제

Flex에서 Canvas 구성 요소 주위에 드롭 그림자를 만들고 싶습니다. 기술적으로 말하면 구성 요소를 감싸기를 원하기 때문에 그림자가 아닙니다. 나는 빛으로 그것을 할 수 있지만 이미 그것을 한 두 줄을 떨어 뜨릴 수 있습니까?

미리 감사드립니다.

도움이 되었습니까?

해결책

나는 실제로 이것을함으로써 그것을 해결했다 :

<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" 
        width="780" height="100%" borderStyle="solid" borderColor="gray"
            creationComplete="init();" backgroundColor="white">

  <mx:Script>
        <![CDATA[
            import mx.styles.StyleManager;


            private function init():void {
                var glow:GlowFilter = new GlowFilter();
                glow.color = StyleManager.getColorName("gray");
                glow.alpha = 0.8;
                glow.blurX = 4;
                glow.blurY = 4;
                glow.strength = 6;
                glow.quality = BitmapFilterQuality.HIGH;

                this.filters = [glow];
            }
        ]]>
    </mx:Script>



</mx:Canvas>

다른 팁

당신이 사용할 수있는 DropShadowFilter 그러나 그것은 거의 같은 것 같다.

<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" 
    width="780" height="100%" borderStyle="solid" borderColor="gray"
    creationComplete="init();" backgroundColor="white" dropShadowEnabled="true">
    <mx:filters>
        <mx:DropShadowFilter
            quality="1"
            color="gray"
            alpha="0.8"
            distance="0"
            blurX="4"
            blurY="4"
            strength="6"
        />
    </mx:filters>
</mx:Canvas>

Flex 4에서는 다음을 사용하고 있습니다. 필터 속성이 이미지에서 아래에서 보이기 때문에 이것을 게시하고 싶었습니다. (예, MX 객체에서 스파크 필터를 사용하고 있다는 것을 알고 있습니다)

 <fx:Declarations>
    <s:GlowFilter
        id="glowBlack"
        alpha=".6"
        color="0x000000"
        inner="false"
        blurX="10"
        blurY="10"
        quality = "2"

        />

             <mx:Image id="rssIcon"
              height="70"
              filters="{[glowBlack]}"
              source="assets/rss/icon_rss.png"
              styleName="rssIconStyle"
              width="70"
              scaleContent="true"
              click="openRssSite(event)"
              "/>

캔버스 외부에서 정의하려면 다음을 수행 할 수 있습니다.

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" 
        width="780" height="100%">

   <mx:Canvas filters="[dropShadow]" width="200" height="200" backgroundColor="white"/>
   <mx:DropShadowFilter id="dropShadow" distance="0"/>

</mx:Application>

당신은 그것을 할 수 있습니다 Degrafa 그리고 스키닝. 그들의 문서는 제한되어 있지만 스킨을 만드는 방법에 대한 튜토리얼 비디오 중 하나를 볼 수 있습니다. 또는 샘플 코드를보십시오. 캔버스의 경계에 Degrafa 프로그래밍 피부를 할당하면 모든 종류의 펑키 한 그라디언트, 경로, 모양 등을 추가 할 수 있습니다.

귀하의 요구에 따라 다음과 같이 도망 갈 수 있습니다.

<mx:Canvas ... dropShadowEnabled="true" shadowDirection="right">

경고가 있습니다 .. 개요 여기

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top