简体   繁体   English

JNI C++ 到 Java 32 位图像无法正确显示

[英]JNI C++ to Java 32 bit image not showing properly

I have the following C++ code for JNI我有以下 JNI 的 C++ 代码

And the following Java code to create a 32bit bufferedimage, the sizes are also received through JNI而下面的Java代码创建了一个32位的bufferedimage,大小也是通过JNI接收的

Everything seems to work only that I have some weird colors in the image and I don't know how to get it right一切似乎都有效,只是我的图像中有一些奇怪的颜色,但我不知道如何正确处理

Result of an image:图像结果:

Isn't this just a mix in the order of the color components?这不就是按照颜色分量的顺序混合吗?

I'm not familiar with any of these functions, but I believe that DIB_RGB_COLORS gives you the components in the “blue, green, red, reserved” order, whereas TYPE_4BYTE_ABGR is expecting the components in the “alpha, blue, green, red” order.我不熟悉这些函数中的任何一个,但我相信DIB_RGB_COLORS“蓝色、绿色、红色、保留”的顺序为您提供组件,而TYPE_4BYTE_ABGR期待“alpha、蓝色、绿色、红色”中的组件命令。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM