ホーム › Devices.ImageAcquisition › WIA_PROPERTY_CONTEXT
WIA_PROPERTY_CONTEXT
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| cProps | DWORD | 4 | +0 | +0 | 管理対象プロパティの数。 |
| pProps | DWORD* | 8/4 | +8 | +4 | プロパティID配列へのポインター。 |
| pChanged | BOOL* | 8/4 | +16 | +8 | 各プロパティの変更有無を示すBOOL配列へのポインター。 |
各言語での定義
#include <windows.h>
// WIA_PROPERTY_CONTEXT (x64 24 / x86 12 バイト)
typedef struct WIA_PROPERTY_CONTEXT {
DWORD cProps;
DWORD* pProps;
BOOL* pChanged;
} WIA_PROPERTY_CONTEXT;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct WIA_PROPERTY_CONTEXT
{
public uint cProps;
public IntPtr pProps;
[MarshalAs(UnmanagedType.Bool)] public bool pChanged;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure WIA_PROPERTY_CONTEXT
Public cProps As UInteger
Public pProps As IntPtr
<MarshalAs(UnmanagedType.Bool)> Public pChanged As Boolean
End Structureimport ctypes
from ctypes import wintypes
class WIA_PROPERTY_CONTEXT(ctypes.Structure):
_fields_ = [
("cProps", wintypes.DWORD),
("pProps", ctypes.c_void_p),
("pChanged", ctypes.c_void_p),
]#[repr(C)]
pub struct WIA_PROPERTY_CONTEXT {
pub cProps: u32,
pub pProps: *mut core::ffi::c_void,
pub pChanged: *mut core::ffi::c_void,
}import "golang.org/x/sys/windows"
type WIA_PROPERTY_CONTEXT struct {
cProps uint32
pProps uintptr
pChanged uintptr
}type
WIA_PROPERTY_CONTEXT = record
cProps: DWORD;
pProps: Pointer;
pChanged: Pointer;
end;const WIA_PROPERTY_CONTEXT = extern struct {
cProps: u32,
pProps: ?*anyopaque,
pChanged: ?*anyopaque,
};type
WIA_PROPERTY_CONTEXT {.bycopy.} = object
cProps: uint32
pProps: pointer
pChanged: pointerstruct WIA_PROPERTY_CONTEXT
{
uint cProps;
void* pProps;
void* pChanged;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; WIA_PROPERTY_CONTEXT サイズ: 12 バイト(x86)
dim st, 3 ; 4byte整数×3(構造体サイズ 12 / 4 切り上げ)
; cProps : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; pProps : DWORD* (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; pChanged : BOOL* (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; WIA_PROPERTY_CONTEXT サイズ: 24 バイト(x64)
dim st, 6 ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; cProps : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; pProps : DWORD* (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; pChanged : BOOL* (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global WIA_PROPERTY_CONTEXT
#field int cProps
#field intptr pProps
#field intptr pChanged
#endstruct
stdim st, WIA_PROPERTY_CONTEXT ; NSTRUCT 変数を確保
st->cProps = 100
mes "cProps=" + st->cProps