본문 바로가기

OM

Color Balance


balance.mxml========================================================================================

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="470" height="680">
 <mx:Style>
  Application{
   backgroundColor : #ffffff;
   fontSize : 12;
  }
 </mx:Style>
 
 <mx:Script>
  <![CDATA[
   import flash.geom.*;
   
   private var tempColor:ColorTransform;
   
   private function slideFunc():void
   {
    tempColor = new ColorTransform(ra.value/100, ga.value/100, rb.value/100, aa.value/100, rb.value, gb.value, bb.value, ab.value);
    img.transform.colorTransform = tempColor;    
   }
  ]]>
 </mx:Script>
 
 <mx:Image x="0" y="0" width="470" height="352" source="@Embed('images/flower.jpg')" id="img"/>
 <mx:Panel x="0" y="348" width="470" height="332" layout="absolute" title="Color Balance">
  <mx:Label x="10" y="10" text="Red" color="#FF0000"/>
  <mx:Label x="10" y="66" text="Green" color="#00FF00"/>
  <mx:Label x="10" y="122" text="Blue" color="#0000FF"/>
  <mx:Label x="10" y="183" text="Alpha"/>
   
  <mx:HSlider x="61" y="10"
   minimum="0" maximum="100" value="100" snapInterval="1"
   change="slideFunc()"
   liveDragging="true" labels="[0, 100]" id="ra"/>
  <mx:HSlider x="61" y="68"
   minimum="0" maximum="100" value="100" snapInterval="1"
   change="slideFunc()"
   liveDragging="true" labels="[0, 100]" id="ga"/>
  <mx:HSlider x="61" y="124"
   minimum="0" maximum="100" value="100" snapInterval="1"
   change="slideFunc()"
   liveDragging="true" labels="[0, 100]" id="ba"/>  
  <mx:HSlider x="61" y="180"
   minimum="0" maximum="100" value="100" snapInterval="1"
   change="slideFunc()"
   liveDragging="true" labels="[0, 100]" id="aa"/>
  <mx:HSlider x="239" y="10"
   minimum="-255" maximum="255" value="0" snapInterval="1"
   change="slideFunc()"
   liveDragging="true" labels="[-255, 0, 255]" id="rb"/>
  <mx:HSlider x="239" y="68"
   minimum="-255" maximum="255" value="0" snapInterval="1"
   change="slideFunc()"
   liveDragging="true" labels="[-255, 0, 255]" id="gb"/>
  <mx:HSlider x="239" y="124"
   minimum="-255" maximum="255" value="0" snapInterval="1"
   change="slideFunc()"
   liveDragging="true" labels="[-255, 0, 255]" id="bb"/>
  <mx:HSlider x="239" y="180"
   minimum="-255" maximum="255" value="0" snapInterval="1"
   change="slideFunc()"
   liveDragging="true" labels="[-255, 0, 255]" id="ab"/>
   
  <mx:Text x="10" y="38" textAlign="right" text="{ra.value + '%'}"/>
  <mx:Text x="10" y="94" textAlign="right" text="{ga.value + '%'}"/>
  <mx:Text x="10" y="150" textAlign="right" text="{ba.value + '%'}"/>
  <mx:Text x="10" y="209" textAlign="right" text="{aa.value + '%'}"/>
  <mx:Text x="407" y="28" textAlign="right" text="{rb.value}"/>
  <mx:Text x="407" y="84" textAlign="right" text="{gb.value}"/>  
  <mx:Text x="407" y="142" textAlign="right" text="{bb.value}"/>
  <mx:Text x="407" y="198" textAlign="right" text="{ab.value}"/>
 
  <mx:HRule x="10" y="56" width="211"/>
  <mx:HRule x="10" y="114" width="211"/>
  <mx:HRule x="10" y="170" width="211"/>
  <mx:HRule x="239" y="56" width="201"/>
  <mx:HRule x="239" y="114" width="201"/>
  <mx:HRule x="239" y="170" width="201"/>
 
  <mx:VRule x="229" y="10" height="219"/>  
 
  <mx:ControlBar horizontalAlign="right">
   <mx:LinkButton label="Created by Shallaa" fontSize="10"
     click="navigateToURL(new URLRequest('http://shallaazm.tistory.com'));"
     textDecoration="underline" alpha="0.20"/>
  </mx:ControlBar>
 </mx:Panel>
</mx:Application>

=====================================================================================================

'OM' 카테고리의 다른 글

에디트 플러스 자바설정  (0) 2008.03.20
가사가 표시되는 MP3 Player  (0) 2008.03.15
MP3 플레이어  (0) 2008.03.13
그림판  (0) 2008.03.13
컬러 팔레트를 이용한 색칠공부  (0) 2008.02.29
컬러 팔레트  (0) 2008.02.28
색칠공부  (4) 2008.02.23
영어 학습 컨텐츠  (0) 2008.02.22
keyUtil  (0) 2008.02.09