`

vertical label

    博客分类:
  • Flex
阅读更多
/** * Author: Lior Gonnen * Date: 17-Nov-2007 * * Please visit: http://liorgonnen.blogspot.com */ package org.pace2020.appbox.components { import flash.display.BitmapData; import flash.display.DisplayObject; import mx.controls.Label; /** * Use this Label class instead of the standard mx.controls.Label to allow text rotation * (using the 'rotation' property) without using embedded fonts! */ public class RotatableLabel extends mx.controls.Label { private var _labelBitmap : BitmapData = null; /** * updateDisplayList is used to draw a rotated bitmap of the label */ protected override function updateDisplayList(unscaledWidth : Number, unscaledHeight : Number) : void { super.updateDisplayList(unscaledWidth, unscaledHeight); // 1. Make sure that the width and the height are greater than zero, otherwise we have nothing to do. // 2. Make sure rotation is different than zero, otherwise the label will show normally // 3. Draw the label into a bitmap, and then draw it onto the label, since the label is rotated // the bitmap will be displayed rotated as well. Nice, ha? ;-) if (unscaledWidth > 0 && unscaledHeight > 0 && rotation != 0) { graphics.clear(); _labelBitmap = getBitmapData(this); if (_labelBitmap) { graphics.beginBitmapFill(_labelBitmap); graphics.drawRect(0, 0, unscaledWidth, unscaledHeight); graphics.endFill(); } } } /** * Create a bitmap from a displayObject * @param target The displayObject to draw * @return The drawn bitmap */ public static function getBitmapData(target : DisplayObject) : BitmapData { var bd : BitmapData = new BitmapData(target.width, target.height, true, 0.0); bd.draw(target); return bd; } } }
分享到:
评论

相关推荐

    LabelView:Inherits from TextView, can set vertical and horizontal label to TextView 继承 TextView,能够在 TextView 上下左右固定设置文本的 View

    Inherits from TextView, can set vertical and horizontal label to TextView 继承 TextView,能够在 TextView 上下左右固定设置文本的 View 以前,我们如果要写出 我的id: drakeet 这样的条目内容,需要使用两个 ...

    margin-top负值解决label 文字与input 垂直居中对齐问题

    label 文字与input 垂直居中对齐不容易调好,试验了padding、vertical-align:middle等都不凑效,如 复制代码代码如下: <label for=’DenyReasonRadio3′><input type=’radio’ name=’DenyReasonRadio’ id=’...

    EhLib v6.1.132 for D7-XE4 FS

    EhLib v6.1.132 for Delphi & C++Builder 7-XE4 Full Source + A new component TDBVertGridEh - DataSet Grid with the ...LabelColParams: TDBVertGridLabelColParamEh - The setting of the column with row label.

    浅谈css中vertical-align和line-height的用法

    (1)、将一个图片放入一个div块中,div块背景颜色设置为aquamarine。将会发现图片与div块下边沿有一定间隙。...css中vertical-align和line-height的用法</title>  <style>  *{

    UserDgHtml

    label id="Sum" CssClass="Label1" runat=...GridLines="Vertical" PageSize="20" BorderWidth="0px" Height="65px" CellSpacing="1" BorderColor="#E7E7FF" BackColor="White" Font-Size="X-Small"> ...

    Ehlib_6.1.129 Full Source 带DEMO

    LabelColParams: TDBVertGridLabelColParamEh - The setting of the column with row label. In DBGridEh + Added an ability to change the size of RowDetailPanel by mouse at RunTime. New properties in ...

    C#经典范例50讲

    this.textBox1.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; this.textBox1.Size = new System.Drawing.Size(368, 200); this.textBox1.TabIndex = 4; this.textBox1.Text = "写入提醒的内容.........

    表单元素radio select对齐与IE6下双边距问题解决方案

    之前一直困扰自己的一个...先上解决方法吧:提示文字须添加label标签,然后样式表里定义input,select,label{vertical-align:middle;}eg.<label for=”bike”>自行车:</label><input type=”checkbox” name=”Bike

    表单元素与提示文字无法对齐的解决方法(input,checkbox文字对齐)

    样式: ... } label { vertical-align: middle; } </style> 使用示例: 复制代码代码如下: <input id=”Checkbox1″ type=”checkbox” /><label for=”Checkbox1″>文本内容</label>

    chartist-plugin-vertical-line:Chartist.js 的简单插件,将在折线图中添加带有可选标签的垂直线

    label : undefined , className : 'vertical-line' } ; Chartist.js 中的示例用法 var chart = new Chartist . Line ( '.ct-chart' , { labels : [ 'Monday' , 'Tuesday' , 'Wednesday' , 'Thursday' , 'Friday'...

    谈谈Android里的Context的使用

    android:orientation="vertical" > android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Welcome to carl shen's blog." /> android:id="@+id/arg_button" ...

    解决echarts中饼图标签重叠的问题

    饼图中的series有个avoidLabelOverlap属性, avoidLabelOverlap:是否启用防止标签重叠策略,默认开启,在标签拥挤重叠的情况下会挪动各个标签的位置,防止标签间的重叠。 ... //orient: "vertical

    vhline_lines_matlab_

    Draws horizontal/vertical lines in graphs. Accept axes handle and allows user to specify label posit

    Bootstrap源码解读标签、徽章、缩略图和警示框(8)

    标签 标签组件通常用来做一些高亮显示用以提醒。使用“.label”样式来实现,可以使用span这样的行内标签,例如:”label”>标签</span> 实现源码如下: ... vertical-align: baseline; border-rad

    CSS 文本域和按钮对齐不一致解决方案

    文字要包含在label标签中,并设置行高,否则文字会与文本框的顶 端对齐。文本框要设置vertical-align:middle;否则文本框与button顶端对齐。button中文字垂直居中,要设置高和行高,行高要小于高。 对input标记设定...

    表单元素和文字垂直居中对齐问题解决整理

    表单页面,为了使表单元素和文字都垂直居中对齐,加个样式input,select{vertical-align:middle},文本框和下拉框都没问题,但是单选框和复选框就杯具了。 大多表现:单选,复选和文字无间距,单选文字偏上,复选偏上...

    vb_ASCII对照

    个label,2个text VERSION 5.00 Begin VB.Form Form1 Caption = "ASCII对照表 制作:雨毅无痕 QQ:775148563" ClientHeight = 6015 ClientLeft = 60 ClientTop = 450 ClientWidth = 8160 Icon = "ASCII对照...

    Ehlib_6.1.129

    LabelColParams: TDBVertGridLabelColParamEh - The setting of the column with row label. See an example of using TDBVertGridEh in a project: <EhLib Archive> \ Demos \ DBVertGridEh.SimpleDemo \ ...

    Ehlib6.1.129

    LabelColParams: TDBVertGridLabelColParamEh - The setting of the column with row label. See an example of using TDBVertGridEh in a project: <EhLib Archive> \ Demos \ DBVertGridEh.SimpleDemo \ ...

    关于echarts在节点显示动态数据及添加提示文本所遇到的问题

    主要介绍了关于echarts在节点显示动态数据及添加提示文本所遇到的问题,需要的朋友可以参考下

Global site tag (gtag.js) - Google Analytics