是否有一种方便的方式将8位值写入BMP,然后在C++中修改调色板?

发布于 2025-01-30 07:25:36 字数 310 浏览 2 评论 0原文

我正在尝试将8位UINT写入BMP文件,并将自己的自定义调色板添加到BMP标题中。我想通过标题中的可选彩色表应用调色板,而不要将灰度值更改为RGB三元组。

我发现这个答案使用C#以这种方式编辑BMP,但是有C ++的方式吗?甚至还有其他容易添加到项目的东西?

“

I am trying to write 8-bit uints to a BMP file and add my own custom colour palette into the BMP header. I want to apply the colour palette through the optional colour table in the header and not change the greyscale values to RGB triples.

I found this answer that uses C# to edit BMPs in this way but is there a C++ way? Or even something else that would be easy to add to the project?

BMP Header specification

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文