flex 画虚线矩形算法
来源:互联网 发布:四维彩超数据看男女 编辑:程序博客网 时间:2024/06/05 04:27
选定矩形的一个顶点为起点,开始画
x0:顶点横坐标
y0:顶点纵坐标
x1:水平线上另一顶点的横坐标
y1:水平线上另一丁点的纵坐标
private function drawDottenRect(g:Graphics,
x0:Number,
y0:Number,
x1:Number,
y1:Number):void{
drawDottedHorizontalLineTo(g,y0,x0,x1);
drawDottedVerticalLineTo(g,x0,y0,y1);
drawDottedHorizontalLineTo(g,y1,x1,x0);
drawDottedVerticalLineTo(g,x1,y0,y1);
}
private function drawDottedHorizontalLineTo(
g:Graphics,
y : Number,
x0 : Number,
x1 : Number
) : void
{
if( x0 < x1){
g.moveTo(x0, y);
for(var x:Number = x0 + start; x<x1; x+= dotLength + gap){
if( x + dotLength + gap <= x1){
g.lineTo(x + dotLength,y);
g.moveTo(x + dotLength + gap, y);
}else{
if(x + dotLength > x1){
g.lineTo(x1, y);
}else{
g.lineTo(x + dotLength,y);
}
}
}
}else{
g.moveTo(x0, y);
for(var xSecond:Number = x0 ; xSecond>x1; xSecond-= dotLength + gap){
if(xSecond - (dotLength + gap )>=x1){
g.lineTo(xSecond - dotLength,y);
g.moveTo(xSecond - dotLength - gap, y);
}else{
if(xSecond - dotLength < x1){
g.lineTo(x1, y);
}else{
g.lineTo( xSecond - dotLength, y);
}
}
}
}
}
private function drawDottedVerticalLineTo(
g:Graphics,
x : Number,
y0 : Number,
y1 : Number
) : void
{
if(y0 <= y1){
g.moveTo(x, y0);
for(var y:Number=y0; y <= y1; y+= dotLength + gap){
if( y + dotLength + gap <= y1){
g.lineTo(x, y + dotLength);
g.moveTo(x, y + dotLength + gap);
}else{
if( y + dotLength > y1){
g.lineTo(x, y1);
}else{
g.lineTo( x, y + dotLength );
}
}
}
}else{
g.moveTo(x, y1);
for(var ySecond:Number = y0; ySecond>= y1; ySecond-=dotLength + gap){
if(ySecond - dotLength - gap >= y1){
g.lineTo(x, ySecond - dotLength);
g.moveTo(x, ySecond - dotLength - gap);
}else{
if(ySecond - dotLength < y1){
g.lineTo(x, y1);
}else{
g.lineTo(x, ySecond - dotLength );
}
}
}
}
}
- flex 画虚线矩形算法
- FLEX 画虚线
- Flex 画虚线类
- flex画虚线
- flex画虚线的方法
- 用opencv画虚线框矩形
- VC中画虚线矩形的方法
- VC中画虚线矩形的方法
- OpenCV 虚线矩形
- 如何在屏幕上画虚线矩形框?
- android 画虚线、实线,画圆角矩形,一半圆角
- android 画虚线、实线,画圆角矩形,一半圆角
- android 画虚线、实线,画圆角矩形,一半圆角
- android 画虚线、实线,画圆角矩形,一半圆角
- android 画虚线、实线,画圆角矩形,一半圆角
- android 画虚线、实线,画圆角矩形,一半圆角
- Android 画虚线、实线,画圆角矩形,一半圆角
- android 画虚线、实线,画圆角矩形,一半圆角
- C/C++文件操作
- 只读权限oracle用户
- 管理理论
- 关系数据库相关概念
- Privileges for Debugging PL/SQL and Java Stored Procedures
- flex 画虚线矩形算法
- sql Exists in
- 初探C#多线程编程
- 手机开发平台的学习指南、教程和资料总结
- [转] Linux System and Performance Monitoring(CPU篇)
- Top 10 qualities of a Software Testing professional
- [转] Linux System and Performance Monitoring(I/O篇)
- [转] Linux System and Performance Monitoring(Memory篇)
- [转] Linux System and Performance Monitoring(Network篇)