利用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 你可能也喜欢 系统的TPS不达标,此时如何优化 谈谈Map、List、Set的区别 最长公共子序列LCS和 最长单调子序列 及其二分优化 redis (四) -redis 常用命令与高级用法(密码及主从复制) Unbuntu下安装ISCSI挂载存储 StratoVirt 中的 PCI 设备热插拔实现 原生axios 的form表单提交 Acwing 每日打卡 一说就懂的 AWS S3 OpenCV中的resize(GPU和CPU) .net mvc3.0 中接收 json 数据,并转换为自定义的 C# 对象 四种常用垃圾收集器 Hugging Face 的 Transformers 库快速入门 (一)开箱即用的 pipelines 自动化运维架构体系 嵌入式室内环境参数监控系统设计 sklearn库svm分类模型及其模型评价 SpringBoot文件下载的时候文件名出现问题 硬件系统工程师宝典(8)—–初识电源完整性分析 yolov5训练数据心得 jeecgboot-web前端首页更换,把默认首页/dashboard/analysis换为其他页面