MAGIMAGEHEADER in java

爱⌒轻易说出口 提交于 2020-01-17 05:37:10

问题


I am creating class for MAGIMAGEHEADER in Java

The Structure of MAGIMAGEHEADER in Winapi is

typedef struct tagMAGIMAGEHEADER {
  UINT               width;
  UINT               height;
  WICPixelFormatGUID format;
  UINT               stride;
  UINT               offset;
  SIZE_T             cbSize;
} MAGIMAGEHEADER, *PMAGIMAGEHEADER;

I have created a equivalent class in Java.

import java.util.Arrays;
import java.util.List;


public class MAGIMAGEHEADER extends com.sun.jna.Structure {
    public int width;
    public int height;
    public Object format;
    public int stride;
    public int offset;
    public int cbsize;

    public List getFieldOrder() {
        return Arrays.asList("width","height","format","stride","offset","cbsize");
    }
}

I have problem with format field, How to define WICPixelFormatGUID in Java?

I didn't find any structure of WICPixelFormatGUID in winapi.


回答1:


As stated in the documentation to which you link, the type is declared in wincodec.h. Search for the type there and you find:

typedef /* [public] */ GUID WICPixelFormatGUID;

So, it is, not surprisingly, a GUID.

I believe that means you need to use com.sun.jna.platform.win32.Guid.GUID.



来源:https://stackoverflow.com/questions/31890413/magimageheader-in-java

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!