批量生成非动画bci图片的工具
2006-10-27 18:07
417 查看
批量生成非动画bci图片的工具
摘要:
BMP转换成BCI的批量处理工具。使用前设置一下BREW_AuthTool程序路径的环境变量。
' 用法:
' 将包含BMP的文件夹托拽到该脚本文件上执行。
' 生成的bci文件将放在该文件夹的bci/子目录中。
' 执行前保证BMP文件夹中没有 disc/ 和 bci/ 2个子目录。
'
双击脚本可获得帮助信息
正文:
[/code]
摘要:
BMP转换成BCI的批量处理工具。使用前设置一下BREW_AuthTool程序路径的环境变量。
' 用法:
' 将包含BMP的文件夹托拽到该脚本文件上执行。
' 生成的bci文件将放在该文件夹的bci/子目录中。
' 执行前保证BMP文件夹中没有 disc/ 和 bci/ 2个子目录。
'
双击脚本可获得帮助信息
正文:
脚本文件内容
' BCI单图自动生成.vbs' 将指定文件夹中的bmp文件转换为bci文件。 ' ' 用法: ' 将包含BMP的文件夹托拽到该脚本文件上执行。 ' 生成的bci文件将放在该文件夹的bci/子目录中。 ' ' 注意: ' 使用前需要设置一下BREW_AuthTool路径的环境变量。 ' 执行前保证BMP文件夹中没有 disc/ 和 bci/ 2个子目录。 ' ' 2006/10/24 ' by D.H. '------------------------------------------------- ' APP NAME APP_NAME = "BREW-BCI单图批量生成工具" '------------------------------------------------- ' BREW BCI AuthoringTool path BREW_BCI_TOOL = "BREW_AuthTool.com" '--------------------------- ' INIT shell Set wshshell = CreateObject("WScript.Shell") '--------------------------- ' FileSystem INIT Dim fs Set fs = CreateObject( "Scripting.FileSystemObject" ) Const ForReading = 1,ForWriting = 2,ForAppending = 8 '--------------------------- ' Access arguments Set args = WScript.Arguments If args.count > 0 Then parentDir = args(0) & "/" Else usage = "将bmp文件夹托拽到该脚本文件上。" & vbCr usage = usage & "或者命令执行:脚本名 bmp文件夹名字" & vbCr & vbCr usage = usage & "确保BMP文件中没有子文件夹 ./disc/;./bci/ " & vbCr usage = usage & "生成的bci存放的子目录 bci/ 中。" & vbCr & vbCr usage = usage & "确保设置了BREW_AuthTool路径的环境变量。" MsgBox usage, vbInformation, APP_NAME WScript.Quit End If '--------------------------- ' path Setting If not fs.FolderExists( parentDir ) Then MsgBox "BMP文件夹不存在!", vbCritical, APP_NAME WScript.Quit End If Set parentFolder = fs.GetFolder( parentDir ) ' bci描述文件目录 discDir = parentDir & "disc/" If not fs.FolderExists( discDir ) Then fs.createFolder( discDir ) End If Set discFolder = fs.GetFolder( discDir ) ' bci生成目录 bciDir = parentDir & "bci/" If Not fs.FolderExists( bciDir ) Then fs.createFolder( bciDir ) End If Set bciFolder = fs.GetFolder( bciDir ) '------------------------------------ ' CREATE txt discription file Set fc = parentFolder.Files For Each srcfile In fc fname = GetFileName( srcfile.name ) fext = GetFileEx( srcfile.name ) If LCase(fext) = "bmp" Then filename = discDir & fname & "." & "txt" Set f = fs.CreateTextFile( filename ) f.writeLine(srcfile.path) f.close End If Next '--------------------------------------- ' CREATE bci file Set fc = discFolder.Files fileCnt = 0 For Each txtfile In fc fname = GetFileName( txtfile.name ) fext = GetFileEx( txtfile.name ) 'MsgBox BREW_BCI_TOOL & " -i " & txtfile.path & " -o " & bciDir & fname & ".bci" wshshell.Run "%COMSPEC% /C " & BREW_BCI_TOOL & " -i " & txtfile.path & " -o " & bciDir & fname & ".bci",,True fileCnt = fileCnt + 1 Next '--------------------------------------- ' 收尾工作 If fs.FolderExists( discDir ) Then fs.DeleteFolder( discFolder.path ) End If '--------------------------------- ' REPORT result report = "Finished." & vbCr report = report & "生成: " & fileCnt & " 个bci文件。" & vbCr report = report & "放在: " + bciDir MsgBox report, vbInformation, APP_NAME '**************************** ' Function GetFileName ' Function GetFileName( filename ) GetFileName = Left( filename,InStrRev( filename, "." ) - 1 ) End Function '**************************** ' Function GetFileEx ' Function GetFileEx( filename ) GetFileEx = Right( filename, Len( filename ) - InStrRev( filename, "." ) ) End Function
[/code]
相关文章推荐
- unity工具IGamesTools之批量生成帧动画
- unity工具IGamesTools之批量生成帧动画
- unity工具IGamesTools之批量生成帧动画
- 自己写的--批量图片转换生成工具(提供源码)
- unity工具IGamesTools之批量生成帧动画
- ArcGIS图框生成和批量打印工具 5.2支持国家2000坐标系,支持ArcGIS10.1、ArcGIS10.2,输出图片可以是TIF和JPG
- A Better Finder Attributes for Mac (文件图片批量修改工具)免注册码 v6.05中文破解版
- PHP批量生成图片缩略图
- 《hhhhold.com》 – 很好玩的随机占位图片生成工具
- Android实用视图动画及工具系列之九:漂亮的图片选择器,高性能防崩溃图片选择工具
- PictureCutting图片批量裁切(裁剪)工具
- 图片生成Gif的golang小工具
- 图片叠加层切片工具支持腾讯地图了!至此,国内地图三巨头都可以用这工具生成图片叠加层
- 安卓开机动画之批量旋转图片(将横…
- 安卓开机动画之批量旋转图片(将横…
- 使用位图字体工具BMFont从图片生成自定义字体
- 批量将导入的图片生成对应的元件调整为无损位图质量,设置链接项导出,发布并生成配置文件,fljs小命令脚本 - [jsfl]
- Thumbnailator java图片压缩,加水印,批量生成缩略图
- 用C#开发一个WinForm版的批量图片压缩工具
- python3.6深度学习图片集处理项目源代码(为cnn等准备图片集合,批量生成、删除、改名、旋转、调整图片大小,包括删除指定路径下所有文件)