Example of how to set bitmap filling background color for panel in flex 4

Source: Internet
Author: User

The following example demonstrates how to use bitmapfill and lineargradient In Flex 4 to set bitmap to fill the background color for the panel.

The following is main. mxml:

 Main. mxml:  <? XML version = "1.0" encoding = "UTF-8" ?>   <  S : Application   Name = "Spark_panel_fill_bitmapfill_test"           Xmlns : FX = Http://ns.adobe.com/mxml/2009"          Xmlns : S = "Library: // ns.adobe.com/flex/spark"           Xmlns : MX = "Library: // ns.adobe.com/flex/halo"  >         <  MX : Applicationcontrolbar   Width = "100%"   Cornerradius = "0" >           <  MX : Form   Stylename = "Plain"  >               <  MX : Formitem   Label = "Rotation :"  >                   <  S : Hslider  ID = "Rotationslider"                           Minimum = "-360"                           Maximum = "360"                           Value = "90"                           Livedragging = "True"                           Width = "{Pnl. Width }"   />               </  MX :Formitem  >               <  MX : Formitem   Label = "Ratio :"  >                   <  S : Hslider   ID = "Ratioslider"                           Minimum = "0.0"                           Maximum ="1.0"                           Value = "0.2"                           Valueinterval = "0.05"                           Livedragging = "True"                           Width = "{Pnl. Width }"   />               </  MX : Formitem  >           </  MX :Form  >       </  MX : Applicationcontrolbar  >         <  S : Panel   ID = "Pnl"               Title = "Spark panel title"               Width = "320"   Height ="240"               Horizontalcenter = "0"   Verticalcenter = "0"  >           <  S : Rect   Width = "100%"   Height = "100%"  >               <  S :Fill  >                   <  S : Bitmapfill   Source = "@ Embed ('Assets/pattern_140.gif ')"   />               </  S : Fill  >           </  S : Rect  >          <  S : Rect   Width = "100%"   Height = "100%"  >               <  S : Fill  >                   <  S : Lineargradient   Rotation ="{Rotationslider. Value }"  >                       <  S : Gradiententry   Color = "White"                               Alpha = "0.0"                               Ratio = "0.0"   />                       <  S : Gradiententry   Color = "# F0ebd2"                               Alpha = "1.0"                               Ratio = "{Ratioslider. Value }"   />                   </  S : Lineargradient  >               </  S : Fill  >           </  S :Rect  >           <  S : Textarea   ID = "Textarea"                   Verticalscrollpolicy = "On"                   Left = "20"   Right = "20"                   Top = "20"   Bottom ="20"  >               <  S : Text  > The quick brown fox jumps over the lazy dog. </  S : Text  >           </  S : Textarea  >       </  S :Panel  >     </  S : Application  > 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.