Win32 API 日本語リファレンス
ホームGraphics.GdiPlus › ImageItemData

ImageItemData

構造体
サイズx64: 40 バイト / x86: 28 バイト

サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。

フィールド

フィールドサイズx64x86説明
SizeDWORD4+0+0この構造体のサイズをバイト単位で表す。
PositionDWORD4+4+4画像内でのアイテムの位置を表す。
Descvoid*8/4+8+8アイテムの説明データへのポインタ。
DescSizeDWORD4+16+12説明データのサイズをバイト単位で表す。
Datavoid*8/4+24+16アイテム本体データへのポインタ。
DataSizeDWORD4+32+20本体データのサイズをバイト単位で表す。
CookieDWORD4+36+24アイテムを識別する識別子(クッキー)を表す。

各言語での定義

#include <windows.h>

// ImageItemData  (x64 40 / x86 28 バイト)
typedef struct ImageItemData {
    DWORD Size;
    DWORD Position;
    void* Desc;
    DWORD DescSize;
    void* Data;
    DWORD DataSize;
    DWORD Cookie;
} ImageItemData;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct ImageItemData
{
    public uint Size;
    public uint Position;
    public IntPtr Desc;
    public uint DescSize;
    public IntPtr Data;
    public uint DataSize;
    public uint Cookie;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure ImageItemData
    Public Size As UInteger
    Public Position As UInteger
    Public Desc As IntPtr
    Public DescSize As UInteger
    Public Data As IntPtr
    Public DataSize As UInteger
    Public Cookie As UInteger
End Structure
import ctypes
from ctypes import wintypes

class ImageItemData(ctypes.Structure):
    _fields_ = [
        ("Size", wintypes.DWORD),
        ("Position", wintypes.DWORD),
        ("Desc", ctypes.c_void_p),
        ("DescSize", wintypes.DWORD),
        ("Data", ctypes.c_void_p),
        ("DataSize", wintypes.DWORD),
        ("Cookie", wintypes.DWORD),
    ]
#[repr(C)]
pub struct ImageItemData {
    pub Size: u32,
    pub Position: u32,
    pub Desc: *mut core::ffi::c_void,
    pub DescSize: u32,
    pub Data: *mut core::ffi::c_void,
    pub DataSize: u32,
    pub Cookie: u32,
}
import "golang.org/x/sys/windows"

type ImageItemData struct {
	Size uint32
	Position uint32
	Desc uintptr
	DescSize uint32
	Data uintptr
	DataSize uint32
	Cookie uint32
}
type
  ImageItemData = record
    Size: DWORD;
    Position: DWORD;
    Desc: Pointer;
    DescSize: DWORD;
    Data: Pointer;
    DataSize: DWORD;
    Cookie: DWORD;
  end;
const ImageItemData = extern struct {
    Size: u32,
    Position: u32,
    Desc: ?*anyopaque,
    DescSize: u32,
    Data: ?*anyopaque,
    DataSize: u32,
    Cookie: u32,
};
type
  ImageItemData {.bycopy.} = object
    Size: uint32
    Position: uint32
    Desc: pointer
    DescSize: uint32
    Data: pointer
    DataSize: uint32
    Cookie: uint32
struct ImageItemData
{
    uint Size;
    uint Position;
    void* Desc;
    uint DescSize;
    void* Data;
    uint DataSize;
    uint Cookie;
}

HSP用 定義

HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; ImageItemData サイズ: 28 バイト(x86)
dim st, 7    ; 4byte整数×7(構造体サイズ 28 / 4 切り上げ)
; Size : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; Position : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; Desc : void* (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; DescSize : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; Data : void* (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; DataSize : DWORD (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; Cookie : DWORD (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; ImageItemData サイズ: 40 バイト(x64)
dim st, 10    ; 4byte整数×10(構造体サイズ 40 / 4 切り上げ)
; Size : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; Position : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; Desc : void* (+8, 8byte)  qpoke st,8,値 / qpeek(st,8)  ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; DescSize : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; Data : void* (+24, 8byte)  qpoke st,24,値 / qpeek(st,24)  ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; DataSize : DWORD (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; Cookie : DWORD (+36, 4byte)  st.9 = 値  /  値 = st.9   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global ImageItemData
    #field int Size
    #field int Position
    #field intptr Desc
    #field int DescSize
    #field intptr Data
    #field int DataSize
    #field int Cookie
#endstruct

stdim st, ImageItemData        ; NSTRUCT 変数を確保
st->Size = 100
mes "Size=" + st->Size