利用GDI+图片格式转换(例如BMP转PNG) Post author:xfxia Post published:2023年9月5日 Post category:其他 主要是先探测目标图片的编码器 然后在把数据以相应的编码存储起来。 如下为 BMP转PNG的 做法. #include <windows.h> #include <gdiplus.h> #include <stdio.h> using namespace Gdiplus; //探测PNG编码器的CLSID 函数 int GetEncoderClsid(const WCHAR* format, CLSID* pClsid); int main() { // 初使化 GDI+. GdiplusStartupInput gdiplusStartupInput; ULONG_PTR gdiplusToken; GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL); CLSID encoderClsid; Status stat; Image* image = new Image(L”图片1.bmp”); // 探测PNG编码器的CLSID GetEncoderClsid(L”image/png”, &encoderClsid); stat = image->Save(L”图片1.png”, &encoderClsid, NULL); if(stat == Ok) printf(“成功!/n”); else printf(“失败: 错误码: %d/n”, stat); delete image; GdiplusShutdown(gdiplusToken); return 0; } int GetEncoderClsid(const WCHAR* format, CLSID* pClsid) { UINT num 版权声明:本文为clodfront原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。 原文链接:https://blog.csdn.net/clodfront/article/details/5489761 你可能也喜欢 Ubuntu下安装Cmake(编译) Mybatis的多表查询 最新微信8.0.1抢红包神器-亲测2021年2月11日可用-安卓&IOS STM32学习笔记(2) 使用外部中断控制按键 SQLAlchemy多表查询(四) vmware 虚拟配置固定IP就无法联网 centos C语言error2005,关于ERROR LNK 2005错误 actionBar获取系统标题栏 显示左箭头以及修改文字/背景色 如何授权域用户安装指定的软件? CentOS光盘挂载命令以及安装软件 LaTeX入门一本地安装-Windows版 卡牌游戏框架设计 使用Flux.jl进行图像分类 windows下安装包制作软件:NSIS的使用方法(以electron为例) 腾讯云新用户怎么配置服务器的方法教程 网络通信误码率测试软件,DMR终端直通模式误码率测试软件的设计与实现 SharePoint添加顶部导航条 K8S-使用ingress做nginx代理 CMake中add_custom_target的使用 基本Widgets(16):【类】QTimeEdit [官翻]