Java中的MAGIMAGEHEADER [英] MAGIMAGEHEADER in java

查看:95
本文介绍了Java中的MAGIMAGEHEADER的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为创建类Java中的MAGIMAGEHEADER

Winapi中MAGIMAGEHEADER的结构是

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;

我已经用Java创建了一个等效的类.

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");
    }
}

format字段有问题,如何在Java中定义WICPixelFormatGUID?

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

我在winapi中找不到WICPixelFormatGUID的任何结构.

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

推荐答案

如您链接到的文档中所述,该类型在wincodec.h中声明.在此处搜索类型,然后找到:

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;

因此,毫无疑问,它是GUID.

So, it is, not surprisingly, a GUID.

我认为这意味着您需要使用

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

这篇关于Java中的MAGIMAGEHEADER的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆