• 博客园logo
  • 会员
  • 周边
  • 新闻
  • 博问
  • 闪存
  • 众包
  • 赞助商
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录

卢晓春的博客

  • 博客园
  • 联系
  • 订阅
  • 管理

公告

View Post

在Powershell环境下,命令行调用BmpCvt,转换png图片为c文件

环境版本

powershell: 5.1.19041.5607
BmpCvt: V5.36c

目标

转换png为 rgb565格式
例如000.png 转化为000.c

软件自带的命令行参考

image

在powershell中调用

.\BmpCvt.exe .\000.png -convertintorgb "-saveas000.c,1" -exit

带参数的ps1文件

文件名 convert.ps1

$input = $args[0]
$output = $args[1]
.\BmpCvt.exe ${input} -convertintorgb "-saveas${output},1" -exit

调用

.\convert.ps1 .\000.png .\000.c

说明

  1. 虽然在软件gui中叫做16bit Color 565,但在命令行中叫做convertintorgb
    image
  2. 由于saveas参数中带".",因此需要用引号括起

posted on 2025-04-23 10:55  卢晓春  阅读(77)  评论(0)    收藏  举报

刷新页面返回顶部
 
博客园  ©  2004-2026
浙公网安备 33010602011771号 浙ICP备2021040463号-3