ホーム › Devices.Display › VIDEO_POINTER_ATTRIBUTES
VIDEO_POINTER_ATTRIBUTES
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| Flags | DWORD | 4 | +0 | +0 | ポインタの属性フラグ(色/モノクロ等、VIDEO_MODE_*)。 |
| Width | DWORD | 4 | +4 | +4 | ポインタの幅(ピクセル)。 |
| Height | DWORD | 4 | +8 | +8 | ポインタの高さ(ピクセル)。 |
| WidthInBytes | DWORD | 4 | +12 | +12 | ポインタ1行のバイト数。 |
| Enable | DWORD | 4 | +16 | +16 | ポインタ表示の有効/無効を示すフラグ。 |
| Column | SHORT | 2 | +20 | +20 | ポインタの列位置。 |
| Row | SHORT | 2 | +22 | +22 | ポインタの行位置。 |
| Pixels | BYTE | 1 | +24 | +24 | ポインタのピクセルデータ(可変長バイト配列)。 |
各言語での定義
#include <windows.h>
// VIDEO_POINTER_ATTRIBUTES (x64 28 / x86 28 バイト)
typedef struct VIDEO_POINTER_ATTRIBUTES {
DWORD Flags;
DWORD Width;
DWORD Height;
DWORD WidthInBytes;
DWORD Enable;
SHORT Column;
SHORT Row;
BYTE Pixels[1];
} VIDEO_POINTER_ATTRIBUTES;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct VIDEO_POINTER_ATTRIBUTES
{
public uint Flags;
public uint Width;
public uint Height;
public uint WidthInBytes;
public uint Enable;
public short Column;
public short Row;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)] public byte[] Pixels;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure VIDEO_POINTER_ATTRIBUTES
Public Flags As UInteger
Public Width As UInteger
Public Height As UInteger
Public WidthInBytes As UInteger
Public Enable As UInteger
Public Column As Short
Public Row As Short
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=1)> Public Pixels() As Byte
End Structureimport ctypes
from ctypes import wintypes
class VIDEO_POINTER_ATTRIBUTES(ctypes.Structure):
_fields_ = [
("Flags", wintypes.DWORD),
("Width", wintypes.DWORD),
("Height", wintypes.DWORD),
("WidthInBytes", wintypes.DWORD),
("Enable", wintypes.DWORD),
("Column", ctypes.c_short),
("Row", ctypes.c_short),
("Pixels", ctypes.c_ubyte * 1),
]#[repr(C)]
pub struct VIDEO_POINTER_ATTRIBUTES {
pub Flags: u32,
pub Width: u32,
pub Height: u32,
pub WidthInBytes: u32,
pub Enable: u32,
pub Column: i16,
pub Row: i16,
pub Pixels: [u8; 1],
}import "golang.org/x/sys/windows"
type VIDEO_POINTER_ATTRIBUTES struct {
Flags uint32
Width uint32
Height uint32
WidthInBytes uint32
Enable uint32
Column int16
Row int16
Pixels [1]byte
}type
VIDEO_POINTER_ATTRIBUTES = record
Flags: DWORD;
Width: DWORD;
Height: DWORD;
WidthInBytes: DWORD;
Enable: DWORD;
Column: Smallint;
Row: Smallint;
Pixels: array[0..0] of Byte;
end;const VIDEO_POINTER_ATTRIBUTES = extern struct {
Flags: u32,
Width: u32,
Height: u32,
WidthInBytes: u32,
Enable: u32,
Column: i16,
Row: i16,
Pixels: [1]u8,
};type
VIDEO_POINTER_ATTRIBUTES {.bycopy.} = object
Flags: uint32
Width: uint32
Height: uint32
WidthInBytes: uint32
Enable: uint32
Column: int16
Row: int16
Pixels: array[1, uint8]struct VIDEO_POINTER_ATTRIBUTES
{
uint Flags;
uint Width;
uint Height;
uint WidthInBytes;
uint Enable;
short Column;
short Row;
ubyte[1] Pixels;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; VIDEO_POINTER_ATTRIBUTES サイズ: 28 バイト(x64)
dim st, 7 ; 4byte整数×7(構造体サイズ 28 / 4 切り上げ)
; Flags : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; Width : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; Height : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; WidthInBytes : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; Enable : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; Column : SHORT (+20, 2byte) wpoke st,20,値 / 値 = wpeek(st,20)
; Row : SHORT (+22, 2byte) wpoke st,22,値 / 値 = wpeek(st,22)
; Pixels : BYTE (+24, 1byte) varptr(st)+24 を基点に操作(1byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global VIDEO_POINTER_ATTRIBUTES
#field int Flags
#field int Width
#field int Height
#field int WidthInBytes
#field int Enable
#field short Column
#field short Row
#field byte Pixels 1
#endstruct
stdim st, VIDEO_POINTER_ATTRIBUTES ; NSTRUCT 変数を確保
st->Flags = 100
mes "Flags=" + st->Flags