Flash 大图片按比例自动缩放
function(target_mc){ var tWidth = 0; var tHeight = 0; var SW = Stage.width; var SH = Stage.height; if (target_mc._width<=SW && target_mc._height<=SH) { ?? tWidth = target_mc._width; ?? tHeight = target_mc._height; } else { ?? var w = target_mc._width/SW; ?? var h = target_mc._height/SH; ?? if (w>h) { ?? ?? tWidth = SW; ?? ?? tHeight = ((w>=1) ? Math.round(target_mc._height/w) : Math.round(target_mc._height*w)); ?? } else if (w<h) { ?? ?? tHeight = SH; ?? ?? tWidth = ((h>=1) ? Math.round(target_mc._width/h) : Math.round(target_mc._width*h)); ?? } else { ?? ?? tWidth = SW; ?? ?? tHeight = SH; ?? } } target_mc._width = tWidth; target_mc._height = tHeight; }; } (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
- &((struct name *)NULL – > b)在printf语句中
- ruby-on-rails – 每次控制器或模型更改时,Rails 5都会重新
- swift – 如何将unmanaged转换为NSData?
- c# – 默认情况下在Windows Phone中加载xaml页面时首先调用
- ruby-on-rails – RSpec spec_helper访问会话变量
- DOJO(二) 基本DOM操作
- Flex中处理Java中的Map参数类型
- Oracle 12.1新特性:在线rename或relocate数据文件
- ecshop ajax无刷新登陆
- ios – 在Xcode更新到4.5版之后Button不起作用