利用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 你可能也喜欢 FAST开发流程和方法 《计算机构造与解释》读书笔记(5) 《西瓜书》第六章 公式6.6 凸二次规划问题 基于JSP的分页技术基础 android 自定义折线图 FastDFS与Springboot集成 matlab cuda 配置,配置matconvnet:Window10+MATLAB R2015b+VS2015+cuda9.1+cudnn7.1.3 IOC核心容器 解析新一代WLAN安全技术IEEE 802.11i、WPA和WAPI Vs code添加自定义snippet 家庭IOT监测之摄像头OV7670测试 js如果在function之前加上感叹号 (!) 等运算符是什么作用 第一章–基础知识 百度网盘:申诉已受理,预计72小时内完成审核与处理 bootstrapTable根据条件改变行字体及背景颜色 nginx 通过 user_agent 识别手机还是pc,解决网站不适配的 跳转 d3dx9 hlsl中if else 和 for语句使用细节 关于Visual Studio 2019 未能加载各种Package包的解决方案 jquery 怎么写if 浏览器提示的”不安全”到底是什么?