`
hgfghe8
  • 浏览: 48975 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
最近访客 更多访客>>
社区版块
存档分类
最新评论

AS3 Scale9 Bitmap类

阅读更多

翻译自:
http://www.uza.lt/codex/as3-scale9-bitmap/
简介:
AS3 Scale9 Bitmap是个辅助的类,使用它可以通过bitmap数据填充创建九宫格sprite,而这些在Flash 9中是无法实现的。这个辅助类根据用户定义的缩放矩阵创建了9个虚拟的九宫格sprite。特别适用于创建用户界面(比如按钮,可伸缩的UI元素等等)。
内容:
Scale9SimpleStateButton - 用于创建可伸缩的1、3 或者3种状态使用bitmap数据(皮肤)的按钮的类。
Scale9SimpleBitmapSprite - 用于创建静态的可伸缩的UI元素的使用bitmap数据(皮肤)的sprite的类。
示例代码(Flex Builder 3 项目)
要求:
ActionScript3
Scale9SimpleStateButton(左上角),Scale9SimpleBitmapSprite(右下角)以及初始的皮肤文件(底部)
示例语法:
Actionscript:
      var scale9_example:Rectangle = new Rectangle(6,6,105,20);
      /* Initialize the button with all 3 states (normal, hover, down) using 3 different bitmaps */
      var button_example:Scale9SimpleStateButton = new Scale9SimpleStateButton(
          scale9_example,
          button_skin_normal.bitmapData,
          button_skin_hover.bitmapData,
          button_skin_down.bitmapData
      );
      /*
        * Scale the button using "width" and "scaleY" properties
        * (in general you can use "width", "height", "scaleY", "scaleX" properties for scaling)
        */
      button_example.width = 300;
      button_example.scaleY = 2;
下载:
http://www.uza.lt/download/2
本文转自:http://www.5uflash.com/flashjiaocheng/Flash-as3-jiaocheng/4911.html
分享到:
评论

相关推荐

    位图bitmap图像文件格式详解与编程PPT

    bitmap图象数据文件格式详解与编程... “A bitmap is a graphical object used to create, manipulate(scale, scroll, rotate, and paint), and store images as files on a disk. ----Microsoft Developer Network ”

    UG6.0快捷键大全

    POPUP_MESSAGE Displays Feature Dimension as PMI. ACTIONS STANDARD BUTTON/HIDE UG_MODELING_SHOW_DIMENSIONS LABEL Show Dimensions MESSAGE Displays Feature Dimensions of selected feature. BITMAP ...

    ehlib_vcl_src_9_3.26

    The Library contains components and classes for Borland Delphi versions 7, 9, Developer Studio 2006, Delphi 2007, Embarcadero RAD Studio 2009-XE10.3, Lazarus. TABLE OF CONTENTS ----------------- ...

    PanoplyWin-4.12.11.zip

    Save plots to disk GIF, JPEG, PNG or TIFF bitmap images or as PDF or PostScript graphics files. Export lon-lat map plots in KMZ format. Export animations as MP4 video or as a collection of invididual ...

    GraphicExD for Delphi 2007,2009

    This library is primarily designed to load images as background (buttons, forms, toolbars) and textures (DirectX, OpenGL) or for image browsing and editing purposes as long as you don't need to save ...

    以二进制形式读取外部图片文件(AIR)

    stage.scaleMode = StageScaleMode.NO_SCALE; buildMenu(); configListeners(); } private function buildMenu():void { rootMenu.addSubmenu(fileMenu, "文件"); fileMenu.addItem(openItem); fileMenu...

    TMS Advanced Charts 2.8

    Different bar shapes such as rectangle, cylinder and pyramid X-axis with index of date/time unit indication Linear or logarithmic Y-scale Y-axis with auto ranging, minor & major value indication ...

    超强的图像处理类CDib

    void SaveAs256Bitmap(const char *pszDibFileName); //存为256色位图 void SaveAsBWBitmap(const char *pszDibFileName); //存为单色位图 void SaveAs256GrayBitmap(const char *pszDibFileName); //存为256级...

    微软内部资料-SQL性能优化2

    If you restart with the 3 GB switch, also known as 4-Gig Tuning, the amount of non-paged pool is reduced to 128 MB from 256 MB. For a process to access 3 GB of address space, the executable image ...

    EhLib 9.1.024

    The Library contains components and classes for Borland Delphi versions 7, 9, Developer Studio 2006, Delphi 2007, Embarcadero RAD Studio 2009-XE10.2, Lazarus. TABLE OF CONTENTS ----------------- ...

    EhLib 6.3 Build 6.3.176 Russian version. Full source included.

    versions 7, 8 & 9 , Borland Developer Studio 2006, CodeGear Delphi 2007, RAD Studio 2009, Embarcadero RAD Studio 2010, RAD Studio XE-XE6. TABLE OF CONTENTS ----------------- Overview Installation ...

    EhLib 8.0 Build 8.0.023 Pro Edition FullSource for D7-XE8

    The Library contains components and classes for Borland Delphi versions 7, 9, Developer Studio 2006, Delphi 2007, Embarcadero RAD Studio 2009-XE8, Lazarus. TABLE OF CONTENTS ----------------- ...

    EhLib5.0.13 最新的ehlib源码

    Ability to scale grid to fit it to page width. Ability to print/preview title for grid. Ability to print/preview page header and page footer where you can specify macros for current page, current...

    Visual C++ 编程资源大全(英文源码 表单)

    07.zip CDialog using animated control 在CDialog中使用动画(12KB)<END><br>8,08.zip Open Dialog with Bitmap Preview 位图预览的打开文件对话框(43KB)<END><br>9,09.zip Standard file open ...

    Android重写Gallery

    This allows the basic animation effects (alpha, scale, translate, rotate) to be accelerated, decelerated, repeated, etc. private Interpolator mDecelerateInterpolater; private ArrayList<View> ...

    PROGRAMMING ACTIONSCRIPT 3.0

    Setting size, scale, and orientation.722 Example: Multiple-page printing.725 Example: Scaling, cropping, and responding..727 Chapter 25: Using the external API...731 Basics of using the external API.....

    新版Android开发教程.rar

    9 什么是 Android? Android? Android? Android? Android 是一个专门针对移动设备的软件集,它包括一个操作系统,中间件和一些重要的应用程序。 Beta 版 的 Android SDK 提供了在 Android 平台上使用 JaVa 语言进行 ...

    Visual C++ 编程资源大全(英文源码 控件)

    1,01.zip 3D Text 显示3D文字(6KB)<END><br>2,02.zip A button within a button 按纽中的按纽(13KB)<END><br>3,03.zip Flat Owner Drawn Buttons 浮动的自画按纽(13KB)<END><br>4,04.zip Flat-...

    FlexGraphics_V_1.79_D4-XE10.2_Downloadly.ir

    - FIX The current scale ignores in TFlexBox.GetRefreshRect and TFlexEllipse.GetRefreshRect methods for pen width calculation. - FIX The method TFlexText.GetRefreshRect don't takes into account the ...

    FastReport.v4.15 for.Delphi.BCB.Full.Source企业版含ClientServer中文修正版支持D4-XE5

    3,2,1,5,4 ) + [enterprise] added variables "AUTHLOGIN" and "AUTHGROUP" inside the any report + [enterprise] now any report file can be matched with any (one and more) group, these reports are ...

Global site tag (gtag.js) - Google Analytics