Win32 API 日本語リファレンス
ホームDevices.Display › GDIINFO

GDIINFO

構造体
サイズx64: 320 バイト / x86: 304 バイト

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

フィールド

フィールドサイズx64x86説明
ulVersionDWORD4+0+0GDI情報構造体のバージョン番号。
ulTechnologyDWORD4+4+4デバイス技術種別(ラスタ/プロッタ等、DT_*)。
ulHorzSizeDWORD4+8+8表示領域の物理的横幅(ミリメートル)。
ulVertSizeDWORD4+12+12表示領域の物理的縦幅(ミリメートル)。
ulHorzResDWORD4+16+16横方向の解像度(ピクセル数)。
ulVertResDWORD4+20+20縦方向の解像度(ピクセル数)。
cBitsPixelDWORD4+24+241ピクセルあたりのビット数(カラープレーンあたり)。
cPlanesDWORD4+28+28カラープレーン数。
ulNumColorsDWORD4+32+32デバイスが表現できる色数(パレットモード時)。
flRasterDWORD4+36+36ラスタ機能フラグ(RC_*)。
ulLogPixelsXDWORD4+40+40論理インチあたりの横ピクセル数(横DPI)。
ulLogPixelsYDWORD4+44+44論理インチあたりの縦ピクセル数(縦DPI)。
flTextCapsDWORD4+48+48テキスト描画機能フラグ(TC_*)。
ulDACRedDWORD4+52+52DACの赤チャネル分解能(ビット数)。
ulDACGreenDWORD4+56+56DACの緑チャネル分解能。
ulDACBlueDWORD4+60+60DACの青チャネル分解能。
ulAspectXDWORD4+64+64ピクセルアスペクト比のX成分。
ulAspectYDWORD4+68+68ピクセルアスペクト比のY成分。
ulAspectXYDWORD4+72+72対角線方向のアスペクト比。
xStyleStepINT4+76+76破線スタイルの水平ステップ単位。
yStyleStepINT4+80+80破線スタイルの垂直ステップ単位。
denStyleStepINT4+84+84スタイルステップの分母(正規化用)。
ptlPhysOffsetPOINTL8+88+88印刷可能領域の物理オフセット(POINTL)。
szlPhysSizeSIZE8+96+96デバイス全体の物理サイズ(SIZE)。
ulNumPalRegDWORD4+104+104パレットレジスタ(エントリ)数。
ciDeviceCOLORINFO120+108+108デバイスの色特性情報(COLORINFO)。
ulDevicePelsDPIDWORD4+228+228デバイスピクセルのDPI(ハーフトーン用)。
ulPrimaryOrderDWORD4+232+232原色のバイト順序(RGB/BGR等、PRIMARY_ORDER_*)。
ulHTPatternSizeDWORD4+236+236ハーフトーンパターンのサイズ(HT_PATSIZE_*)。
ulHTOutputFormatDWORD4+240+240ハーフトーン出力形式(HT_FORMAT_*)。
flHTFlagsDWORD4+244+244ハーフトーン処理フラグ(HT_FLAG_*)。
ulVRefreshDWORD4+248+248垂直リフレッシュレート(Hz)。
ulBltAlignmentDWORD4+252+252BitBlt時の水平アライメント境界。0なら制約なし。
ulPanningHorzResDWORD4+256+256パンニング時の横解像度。
ulPanningVertResDWORD4+260+260パンニング時の縦解像度。
xPanningAlignmentDWORD4+264+264パンニングの水平アライメント。
yPanningAlignmentDWORD4+268+268パンニングの垂直アライメント。
cxHTPatDWORD4+272+272ハーフトーンパターンの幅。
cyHTPatDWORD4+276+276ハーフトーンパターンの高さ。
pHTPatABYTE*8/4+280+280ハーフトーンパターンAへのバイトポインタ。
pHTPatBBYTE*8/4+288+284ハーフトーンパターンBへのバイトポインタ。
pHTPatCBYTE*8/4+296+288ハーフトーンパターンCへのバイトポインタ。
flShadeBlendDWORD4+304+292シェーディング・ブレンド機能フラグ(SB_*)。
ulPhysicalPixelCharacteristicsDWORD4+308+296物理ピクセルの配置特性(ClearType用、PPC_*)。
ulPhysicalPixelGammaDWORD4+312+300物理ピクセルのガンマ値(ClearType用)。

各言語での定義

#include <windows.h>

// POINTL  (x64 8 / x86 8 バイト)
typedef struct POINTL {
    INT x;
    INT y;
} POINTL;

// SIZE  (x64 8 / x86 8 バイト)
typedef struct SIZE {
    INT cx;
    INT cy;
} SIZE;

// CIECHROMA  (x64 12 / x86 12 バイト)
typedef struct CIECHROMA {
    INT x;
    INT y;
    INT Y;
} CIECHROMA;

// COLORINFO  (x64 120 / x86 120 バイト)
typedef struct COLORINFO {
    CIECHROMA Red;
    CIECHROMA Green;
    CIECHROMA Blue;
    CIECHROMA Cyan;
    CIECHROMA Magenta;
    CIECHROMA Yellow;
    CIECHROMA AlignmentWhite;
    INT RedGamma;
    INT GreenGamma;
    INT BlueGamma;
    INT MagentaInCyanDye;
    INT YellowInCyanDye;
    INT CyanInMagentaDye;
    INT YellowInMagentaDye;
    INT CyanInYellowDye;
    INT MagentaInYellowDye;
} COLORINFO;

// GDIINFO  (x64 320 / x86 304 バイト)
typedef struct GDIINFO {
    DWORD ulVersion;
    DWORD ulTechnology;
    DWORD ulHorzSize;
    DWORD ulVertSize;
    DWORD ulHorzRes;
    DWORD ulVertRes;
    DWORD cBitsPixel;
    DWORD cPlanes;
    DWORD ulNumColors;
    DWORD flRaster;
    DWORD ulLogPixelsX;
    DWORD ulLogPixelsY;
    DWORD flTextCaps;
    DWORD ulDACRed;
    DWORD ulDACGreen;
    DWORD ulDACBlue;
    DWORD ulAspectX;
    DWORD ulAspectY;
    DWORD ulAspectXY;
    INT xStyleStep;
    INT yStyleStep;
    INT denStyleStep;
    POINTL ptlPhysOffset;
    SIZE szlPhysSize;
    DWORD ulNumPalReg;
    COLORINFO ciDevice;
    DWORD ulDevicePelsDPI;
    DWORD ulPrimaryOrder;
    DWORD ulHTPatternSize;
    DWORD ulHTOutputFormat;
    DWORD flHTFlags;
    DWORD ulVRefresh;
    DWORD ulBltAlignment;
    DWORD ulPanningHorzRes;
    DWORD ulPanningVertRes;
    DWORD xPanningAlignment;
    DWORD yPanningAlignment;
    DWORD cxHTPat;
    DWORD cyHTPat;
    BYTE* pHTPatA;
    BYTE* pHTPatB;
    BYTE* pHTPatC;
    DWORD flShadeBlend;
    DWORD ulPhysicalPixelCharacteristics;
    DWORD ulPhysicalPixelGamma;
} GDIINFO;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct POINTL
{
    public int x;
    public int y;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct SIZE
{
    public int cx;
    public int cy;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct CIECHROMA
{
    public int x;
    public int y;
    public int Y;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct COLORINFO
{
    public CIECHROMA Red;
    public CIECHROMA Green;
    public CIECHROMA Blue;
    public CIECHROMA Cyan;
    public CIECHROMA Magenta;
    public CIECHROMA Yellow;
    public CIECHROMA AlignmentWhite;
    public int RedGamma;
    public int GreenGamma;
    public int BlueGamma;
    public int MagentaInCyanDye;
    public int YellowInCyanDye;
    public int CyanInMagentaDye;
    public int YellowInMagentaDye;
    public int CyanInYellowDye;
    public int MagentaInYellowDye;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct GDIINFO
{
    public uint ulVersion;
    public uint ulTechnology;
    public uint ulHorzSize;
    public uint ulVertSize;
    public uint ulHorzRes;
    public uint ulVertRes;
    public uint cBitsPixel;
    public uint cPlanes;
    public uint ulNumColors;
    public uint flRaster;
    public uint ulLogPixelsX;
    public uint ulLogPixelsY;
    public uint flTextCaps;
    public uint ulDACRed;
    public uint ulDACGreen;
    public uint ulDACBlue;
    public uint ulAspectX;
    public uint ulAspectY;
    public uint ulAspectXY;
    public int xStyleStep;
    public int yStyleStep;
    public int denStyleStep;
    public POINTL ptlPhysOffset;
    public SIZE szlPhysSize;
    public uint ulNumPalReg;
    public COLORINFO ciDevice;
    public uint ulDevicePelsDPI;
    public uint ulPrimaryOrder;
    public uint ulHTPatternSize;
    public uint ulHTOutputFormat;
    public uint flHTFlags;
    public uint ulVRefresh;
    public uint ulBltAlignment;
    public uint ulPanningHorzRes;
    public uint ulPanningVertRes;
    public uint xPanningAlignment;
    public uint yPanningAlignment;
    public uint cxHTPat;
    public uint cyHTPat;
    public IntPtr pHTPatA;
    public IntPtr pHTPatB;
    public IntPtr pHTPatC;
    public uint flShadeBlend;
    public uint ulPhysicalPixelCharacteristics;
    public uint ulPhysicalPixelGamma;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure POINTL
    Public x As Integer
    Public y As Integer
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure SIZE
    Public cx As Integer
    Public cy As Integer
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure CIECHROMA
    Public x As Integer
    Public y As Integer
    Public Y As Integer
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure COLORINFO
    Public Red As CIECHROMA
    Public Green As CIECHROMA
    Public Blue As CIECHROMA
    Public Cyan As CIECHROMA
    Public Magenta As CIECHROMA
    Public Yellow As CIECHROMA
    Public AlignmentWhite As CIECHROMA
    Public RedGamma As Integer
    Public GreenGamma As Integer
    Public BlueGamma As Integer
    Public MagentaInCyanDye As Integer
    Public YellowInCyanDye As Integer
    Public CyanInMagentaDye As Integer
    Public YellowInMagentaDye As Integer
    Public CyanInYellowDye As Integer
    Public MagentaInYellowDye As Integer
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure GDIINFO
    Public ulVersion As UInteger
    Public ulTechnology As UInteger
    Public ulHorzSize As UInteger
    Public ulVertSize As UInteger
    Public ulHorzRes As UInteger
    Public ulVertRes As UInteger
    Public cBitsPixel As UInteger
    Public cPlanes As UInteger
    Public ulNumColors As UInteger
    Public flRaster As UInteger
    Public ulLogPixelsX As UInteger
    Public ulLogPixelsY As UInteger
    Public flTextCaps As UInteger
    Public ulDACRed As UInteger
    Public ulDACGreen As UInteger
    Public ulDACBlue As UInteger
    Public ulAspectX As UInteger
    Public ulAspectY As UInteger
    Public ulAspectXY As UInteger
    Public xStyleStep As Integer
    Public yStyleStep As Integer
    Public denStyleStep As Integer
    Public ptlPhysOffset As POINTL
    Public szlPhysSize As SIZE
    Public ulNumPalReg As UInteger
    Public ciDevice As COLORINFO
    Public ulDevicePelsDPI As UInteger
    Public ulPrimaryOrder As UInteger
    Public ulHTPatternSize As UInteger
    Public ulHTOutputFormat As UInteger
    Public flHTFlags As UInteger
    Public ulVRefresh As UInteger
    Public ulBltAlignment As UInteger
    Public ulPanningHorzRes As UInteger
    Public ulPanningVertRes As UInteger
    Public xPanningAlignment As UInteger
    Public yPanningAlignment As UInteger
    Public cxHTPat As UInteger
    Public cyHTPat As UInteger
    Public pHTPatA As IntPtr
    Public pHTPatB As IntPtr
    Public pHTPatC As IntPtr
    Public flShadeBlend As UInteger
    Public ulPhysicalPixelCharacteristics As UInteger
    Public ulPhysicalPixelGamma As UInteger
End Structure
import ctypes
from ctypes import wintypes

class POINTL(ctypes.Structure):
    _fields_ = [
        ("x", ctypes.c_int),
        ("y", ctypes.c_int),
    ]

class SIZE(ctypes.Structure):
    _fields_ = [
        ("cx", ctypes.c_int),
        ("cy", ctypes.c_int),
    ]

class CIECHROMA(ctypes.Structure):
    _fields_ = [
        ("x", ctypes.c_int),
        ("y", ctypes.c_int),
        ("Y", ctypes.c_int),
    ]

class COLORINFO(ctypes.Structure):
    _fields_ = [
        ("Red", CIECHROMA),
        ("Green", CIECHROMA),
        ("Blue", CIECHROMA),
        ("Cyan", CIECHROMA),
        ("Magenta", CIECHROMA),
        ("Yellow", CIECHROMA),
        ("AlignmentWhite", CIECHROMA),
        ("RedGamma", ctypes.c_int),
        ("GreenGamma", ctypes.c_int),
        ("BlueGamma", ctypes.c_int),
        ("MagentaInCyanDye", ctypes.c_int),
        ("YellowInCyanDye", ctypes.c_int),
        ("CyanInMagentaDye", ctypes.c_int),
        ("YellowInMagentaDye", ctypes.c_int),
        ("CyanInYellowDye", ctypes.c_int),
        ("MagentaInYellowDye", ctypes.c_int),
    ]

class GDIINFO(ctypes.Structure):
    _fields_ = [
        ("ulVersion", wintypes.DWORD),
        ("ulTechnology", wintypes.DWORD),
        ("ulHorzSize", wintypes.DWORD),
        ("ulVertSize", wintypes.DWORD),
        ("ulHorzRes", wintypes.DWORD),
        ("ulVertRes", wintypes.DWORD),
        ("cBitsPixel", wintypes.DWORD),
        ("cPlanes", wintypes.DWORD),
        ("ulNumColors", wintypes.DWORD),
        ("flRaster", wintypes.DWORD),
        ("ulLogPixelsX", wintypes.DWORD),
        ("ulLogPixelsY", wintypes.DWORD),
        ("flTextCaps", wintypes.DWORD),
        ("ulDACRed", wintypes.DWORD),
        ("ulDACGreen", wintypes.DWORD),
        ("ulDACBlue", wintypes.DWORD),
        ("ulAspectX", wintypes.DWORD),
        ("ulAspectY", wintypes.DWORD),
        ("ulAspectXY", wintypes.DWORD),
        ("xStyleStep", ctypes.c_int),
        ("yStyleStep", ctypes.c_int),
        ("denStyleStep", ctypes.c_int),
        ("ptlPhysOffset", POINTL),
        ("szlPhysSize", SIZE),
        ("ulNumPalReg", wintypes.DWORD),
        ("ciDevice", COLORINFO),
        ("ulDevicePelsDPI", wintypes.DWORD),
        ("ulPrimaryOrder", wintypes.DWORD),
        ("ulHTPatternSize", wintypes.DWORD),
        ("ulHTOutputFormat", wintypes.DWORD),
        ("flHTFlags", wintypes.DWORD),
        ("ulVRefresh", wintypes.DWORD),
        ("ulBltAlignment", wintypes.DWORD),
        ("ulPanningHorzRes", wintypes.DWORD),
        ("ulPanningVertRes", wintypes.DWORD),
        ("xPanningAlignment", wintypes.DWORD),
        ("yPanningAlignment", wintypes.DWORD),
        ("cxHTPat", wintypes.DWORD),
        ("cyHTPat", wintypes.DWORD),
        ("pHTPatA", ctypes.c_void_p),
        ("pHTPatB", ctypes.c_void_p),
        ("pHTPatC", ctypes.c_void_p),
        ("flShadeBlend", wintypes.DWORD),
        ("ulPhysicalPixelCharacteristics", wintypes.DWORD),
        ("ulPhysicalPixelGamma", wintypes.DWORD),
    ]
#[repr(C)]
pub struct POINTL {
    pub x: i32,
    pub y: i32,
}

#[repr(C)]
pub struct SIZE {
    pub cx: i32,
    pub cy: i32,
}

#[repr(C)]
pub struct CIECHROMA {
    pub x: i32,
    pub y: i32,
    pub Y: i32,
}

#[repr(C)]
pub struct COLORINFO {
    pub Red: CIECHROMA,
    pub Green: CIECHROMA,
    pub Blue: CIECHROMA,
    pub Cyan: CIECHROMA,
    pub Magenta: CIECHROMA,
    pub Yellow: CIECHROMA,
    pub AlignmentWhite: CIECHROMA,
    pub RedGamma: i32,
    pub GreenGamma: i32,
    pub BlueGamma: i32,
    pub MagentaInCyanDye: i32,
    pub YellowInCyanDye: i32,
    pub CyanInMagentaDye: i32,
    pub YellowInMagentaDye: i32,
    pub CyanInYellowDye: i32,
    pub MagentaInYellowDye: i32,
}

#[repr(C)]
pub struct GDIINFO {
    pub ulVersion: u32,
    pub ulTechnology: u32,
    pub ulHorzSize: u32,
    pub ulVertSize: u32,
    pub ulHorzRes: u32,
    pub ulVertRes: u32,
    pub cBitsPixel: u32,
    pub cPlanes: u32,
    pub ulNumColors: u32,
    pub flRaster: u32,
    pub ulLogPixelsX: u32,
    pub ulLogPixelsY: u32,
    pub flTextCaps: u32,
    pub ulDACRed: u32,
    pub ulDACGreen: u32,
    pub ulDACBlue: u32,
    pub ulAspectX: u32,
    pub ulAspectY: u32,
    pub ulAspectXY: u32,
    pub xStyleStep: i32,
    pub yStyleStep: i32,
    pub denStyleStep: i32,
    pub ptlPhysOffset: POINTL,
    pub szlPhysSize: SIZE,
    pub ulNumPalReg: u32,
    pub ciDevice: COLORINFO,
    pub ulDevicePelsDPI: u32,
    pub ulPrimaryOrder: u32,
    pub ulHTPatternSize: u32,
    pub ulHTOutputFormat: u32,
    pub flHTFlags: u32,
    pub ulVRefresh: u32,
    pub ulBltAlignment: u32,
    pub ulPanningHorzRes: u32,
    pub ulPanningVertRes: u32,
    pub xPanningAlignment: u32,
    pub yPanningAlignment: u32,
    pub cxHTPat: u32,
    pub cyHTPat: u32,
    pub pHTPatA: *mut core::ffi::c_void,
    pub pHTPatB: *mut core::ffi::c_void,
    pub pHTPatC: *mut core::ffi::c_void,
    pub flShadeBlend: u32,
    pub ulPhysicalPixelCharacteristics: u32,
    pub ulPhysicalPixelGamma: u32,
}
import "golang.org/x/sys/windows"

type POINTL struct {
	x int32
	y int32
}

type SIZE struct {
	cx int32
	cy int32
}

type CIECHROMA struct {
	x int32
	y int32
	Y int32
}

type COLORINFO struct {
	Red CIECHROMA
	Green CIECHROMA
	Blue CIECHROMA
	Cyan CIECHROMA
	Magenta CIECHROMA
	Yellow CIECHROMA
	AlignmentWhite CIECHROMA
	RedGamma int32
	GreenGamma int32
	BlueGamma int32
	MagentaInCyanDye int32
	YellowInCyanDye int32
	CyanInMagentaDye int32
	YellowInMagentaDye int32
	CyanInYellowDye int32
	MagentaInYellowDye int32
}

type GDIINFO struct {
	ulVersion uint32
	ulTechnology uint32
	ulHorzSize uint32
	ulVertSize uint32
	ulHorzRes uint32
	ulVertRes uint32
	cBitsPixel uint32
	cPlanes uint32
	ulNumColors uint32
	flRaster uint32
	ulLogPixelsX uint32
	ulLogPixelsY uint32
	flTextCaps uint32
	ulDACRed uint32
	ulDACGreen uint32
	ulDACBlue uint32
	ulAspectX uint32
	ulAspectY uint32
	ulAspectXY uint32
	xStyleStep int32
	yStyleStep int32
	denStyleStep int32
	ptlPhysOffset POINTL
	szlPhysSize SIZE
	ulNumPalReg uint32
	ciDevice COLORINFO
	ulDevicePelsDPI uint32
	ulPrimaryOrder uint32
	ulHTPatternSize uint32
	ulHTOutputFormat uint32
	flHTFlags uint32
	ulVRefresh uint32
	ulBltAlignment uint32
	ulPanningHorzRes uint32
	ulPanningVertRes uint32
	xPanningAlignment uint32
	yPanningAlignment uint32
	cxHTPat uint32
	cyHTPat uint32
	pHTPatA uintptr
	pHTPatB uintptr
	pHTPatC uintptr
	flShadeBlend uint32
	ulPhysicalPixelCharacteristics uint32
	ulPhysicalPixelGamma uint32
}
type
  POINTL = record
    x: Integer;
    y: Integer;
  end;

  SIZE = record
    cx: Integer;
    cy: Integer;
  end;

  CIECHROMA = record
    x: Integer;
    y: Integer;
    Y: Integer;
  end;

  COLORINFO = record
    Red: CIECHROMA;
    Green: CIECHROMA;
    Blue: CIECHROMA;
    Cyan: CIECHROMA;
    Magenta: CIECHROMA;
    Yellow: CIECHROMA;
    AlignmentWhite: CIECHROMA;
    RedGamma: Integer;
    GreenGamma: Integer;
    BlueGamma: Integer;
    MagentaInCyanDye: Integer;
    YellowInCyanDye: Integer;
    CyanInMagentaDye: Integer;
    YellowInMagentaDye: Integer;
    CyanInYellowDye: Integer;
    MagentaInYellowDye: Integer;
  end;

  GDIINFO = record
    ulVersion: DWORD;
    ulTechnology: DWORD;
    ulHorzSize: DWORD;
    ulVertSize: DWORD;
    ulHorzRes: DWORD;
    ulVertRes: DWORD;
    cBitsPixel: DWORD;
    cPlanes: DWORD;
    ulNumColors: DWORD;
    flRaster: DWORD;
    ulLogPixelsX: DWORD;
    ulLogPixelsY: DWORD;
    flTextCaps: DWORD;
    ulDACRed: DWORD;
    ulDACGreen: DWORD;
    ulDACBlue: DWORD;
    ulAspectX: DWORD;
    ulAspectY: DWORD;
    ulAspectXY: DWORD;
    xStyleStep: Integer;
    yStyleStep: Integer;
    denStyleStep: Integer;
    ptlPhysOffset: POINTL;
    szlPhysSize: SIZE;
    ulNumPalReg: DWORD;
    ciDevice: COLORINFO;
    ulDevicePelsDPI: DWORD;
    ulPrimaryOrder: DWORD;
    ulHTPatternSize: DWORD;
    ulHTOutputFormat: DWORD;
    flHTFlags: DWORD;
    ulVRefresh: DWORD;
    ulBltAlignment: DWORD;
    ulPanningHorzRes: DWORD;
    ulPanningVertRes: DWORD;
    xPanningAlignment: DWORD;
    yPanningAlignment: DWORD;
    cxHTPat: DWORD;
    cyHTPat: DWORD;
    pHTPatA: Pointer;
    pHTPatB: Pointer;
    pHTPatC: Pointer;
    flShadeBlend: DWORD;
    ulPhysicalPixelCharacteristics: DWORD;
    ulPhysicalPixelGamma: DWORD;
  end;
const POINTL = extern struct {
    x: i32,
    y: i32,
};

const SIZE = extern struct {
    cx: i32,
    cy: i32,
};

const CIECHROMA = extern struct {
    x: i32,
    y: i32,
    Y: i32,
};

const COLORINFO = extern struct {
    Red: CIECHROMA,
    Green: CIECHROMA,
    Blue: CIECHROMA,
    Cyan: CIECHROMA,
    Magenta: CIECHROMA,
    Yellow: CIECHROMA,
    AlignmentWhite: CIECHROMA,
    RedGamma: i32,
    GreenGamma: i32,
    BlueGamma: i32,
    MagentaInCyanDye: i32,
    YellowInCyanDye: i32,
    CyanInMagentaDye: i32,
    YellowInMagentaDye: i32,
    CyanInYellowDye: i32,
    MagentaInYellowDye: i32,
};

const GDIINFO = extern struct {
    ulVersion: u32,
    ulTechnology: u32,
    ulHorzSize: u32,
    ulVertSize: u32,
    ulHorzRes: u32,
    ulVertRes: u32,
    cBitsPixel: u32,
    cPlanes: u32,
    ulNumColors: u32,
    flRaster: u32,
    ulLogPixelsX: u32,
    ulLogPixelsY: u32,
    flTextCaps: u32,
    ulDACRed: u32,
    ulDACGreen: u32,
    ulDACBlue: u32,
    ulAspectX: u32,
    ulAspectY: u32,
    ulAspectXY: u32,
    xStyleStep: i32,
    yStyleStep: i32,
    denStyleStep: i32,
    ptlPhysOffset: POINTL,
    szlPhysSize: SIZE,
    ulNumPalReg: u32,
    ciDevice: COLORINFO,
    ulDevicePelsDPI: u32,
    ulPrimaryOrder: u32,
    ulHTPatternSize: u32,
    ulHTOutputFormat: u32,
    flHTFlags: u32,
    ulVRefresh: u32,
    ulBltAlignment: u32,
    ulPanningHorzRes: u32,
    ulPanningVertRes: u32,
    xPanningAlignment: u32,
    yPanningAlignment: u32,
    cxHTPat: u32,
    cyHTPat: u32,
    pHTPatA: ?*anyopaque,
    pHTPatB: ?*anyopaque,
    pHTPatC: ?*anyopaque,
    flShadeBlend: u32,
    ulPhysicalPixelCharacteristics: u32,
    ulPhysicalPixelGamma: u32,
};
type
  POINTL {.bycopy.} = object
    x: int32
    y: int32

  SIZE {.bycopy.} = object
    cx: int32
    cy: int32

  CIECHROMA {.bycopy.} = object
    x: int32
    y: int32
    Y: int32

  COLORINFO {.bycopy.} = object
    Red: CIECHROMA
    Green: CIECHROMA
    Blue: CIECHROMA
    Cyan: CIECHROMA
    Magenta: CIECHROMA
    Yellow: CIECHROMA
    AlignmentWhite: CIECHROMA
    RedGamma: int32
    GreenGamma: int32
    BlueGamma: int32
    MagentaInCyanDye: int32
    YellowInCyanDye: int32
    CyanInMagentaDye: int32
    YellowInMagentaDye: int32
    CyanInYellowDye: int32
    MagentaInYellowDye: int32

  GDIINFO {.bycopy.} = object
    ulVersion: uint32
    ulTechnology: uint32
    ulHorzSize: uint32
    ulVertSize: uint32
    ulHorzRes: uint32
    ulVertRes: uint32
    cBitsPixel: uint32
    cPlanes: uint32
    ulNumColors: uint32
    flRaster: uint32
    ulLogPixelsX: uint32
    ulLogPixelsY: uint32
    flTextCaps: uint32
    ulDACRed: uint32
    ulDACGreen: uint32
    ulDACBlue: uint32
    ulAspectX: uint32
    ulAspectY: uint32
    ulAspectXY: uint32
    xStyleStep: int32
    yStyleStep: int32
    denStyleStep: int32
    ptlPhysOffset: POINTL
    szlPhysSize: SIZE
    ulNumPalReg: uint32
    ciDevice: COLORINFO
    ulDevicePelsDPI: uint32
    ulPrimaryOrder: uint32
    ulHTPatternSize: uint32
    ulHTOutputFormat: uint32
    flHTFlags: uint32
    ulVRefresh: uint32
    ulBltAlignment: uint32
    ulPanningHorzRes: uint32
    ulPanningVertRes: uint32
    xPanningAlignment: uint32
    yPanningAlignment: uint32
    cxHTPat: uint32
    cyHTPat: uint32
    pHTPatA: pointer
    pHTPatB: pointer
    pHTPatC: pointer
    flShadeBlend: uint32
    ulPhysicalPixelCharacteristics: uint32
    ulPhysicalPixelGamma: uint32
struct POINTL
{
    int x;
    int y;
}

struct SIZE
{
    int cx;
    int cy;
}

struct CIECHROMA
{
    int x;
    int y;
    int Y;
}

struct COLORINFO
{
    CIECHROMA Red;
    CIECHROMA Green;
    CIECHROMA Blue;
    CIECHROMA Cyan;
    CIECHROMA Magenta;
    CIECHROMA Yellow;
    CIECHROMA AlignmentWhite;
    int RedGamma;
    int GreenGamma;
    int BlueGamma;
    int MagentaInCyanDye;
    int YellowInCyanDye;
    int CyanInMagentaDye;
    int YellowInMagentaDye;
    int CyanInYellowDye;
    int MagentaInYellowDye;
}

struct GDIINFO
{
    uint ulVersion;
    uint ulTechnology;
    uint ulHorzSize;
    uint ulVertSize;
    uint ulHorzRes;
    uint ulVertRes;
    uint cBitsPixel;
    uint cPlanes;
    uint ulNumColors;
    uint flRaster;
    uint ulLogPixelsX;
    uint ulLogPixelsY;
    uint flTextCaps;
    uint ulDACRed;
    uint ulDACGreen;
    uint ulDACBlue;
    uint ulAspectX;
    uint ulAspectY;
    uint ulAspectXY;
    int xStyleStep;
    int yStyleStep;
    int denStyleStep;
    POINTL ptlPhysOffset;
    SIZE szlPhysSize;
    uint ulNumPalReg;
    COLORINFO ciDevice;
    uint ulDevicePelsDPI;
    uint ulPrimaryOrder;
    uint ulHTPatternSize;
    uint ulHTOutputFormat;
    uint flHTFlags;
    uint ulVRefresh;
    uint ulBltAlignment;
    uint ulPanningHorzRes;
    uint ulPanningVertRes;
    uint xPanningAlignment;
    uint yPanningAlignment;
    uint cxHTPat;
    uint cyHTPat;
    void* pHTPatA;
    void* pHTPatB;
    void* pHTPatC;
    uint flShadeBlend;
    uint ulPhysicalPixelCharacteristics;
    uint ulPhysicalPixelGamma;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; GDIINFO サイズ: 304 バイト(x86)
dim st, 76    ; 4byte整数×76(構造体サイズ 304 / 4 切り上げ)
; ulVersion : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; ulTechnology : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; ulHorzSize : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; ulVertSize : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; ulHorzRes : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; ulVertRes : DWORD (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; cBitsPixel : DWORD (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; cPlanes : DWORD (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; ulNumColors : DWORD (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; flRaster : DWORD (+36, 4byte)  st.9 = 値  /  値 = st.9   (lpoke/lpeek も可)
; ulLogPixelsX : DWORD (+40, 4byte)  st.10 = 値  /  値 = st.10   (lpoke/lpeek も可)
; ulLogPixelsY : DWORD (+44, 4byte)  st.11 = 値  /  値 = st.11   (lpoke/lpeek も可)
; flTextCaps : DWORD (+48, 4byte)  st.12 = 値  /  値 = st.12   (lpoke/lpeek も可)
; ulDACRed : DWORD (+52, 4byte)  st.13 = 値  /  値 = st.13   (lpoke/lpeek も可)
; ulDACGreen : DWORD (+56, 4byte)  st.14 = 値  /  値 = st.14   (lpoke/lpeek も可)
; ulDACBlue : DWORD (+60, 4byte)  st.15 = 値  /  値 = st.15   (lpoke/lpeek も可)
; ulAspectX : DWORD (+64, 4byte)  st.16 = 値  /  値 = st.16   (lpoke/lpeek も可)
; ulAspectY : DWORD (+68, 4byte)  st.17 = 値  /  値 = st.17   (lpoke/lpeek も可)
; ulAspectXY : DWORD (+72, 4byte)  st.18 = 値  /  値 = st.18   (lpoke/lpeek も可)
; xStyleStep : INT (+76, 4byte)  st.19 = 値  /  値 = st.19   (lpoke/lpeek も可)
; yStyleStep : INT (+80, 4byte)  st.20 = 値  /  値 = st.20   (lpoke/lpeek も可)
; denStyleStep : INT (+84, 4byte)  st.21 = 値  /  値 = st.21   (lpoke/lpeek も可)
; ptlPhysOffset : POINTL (+88, 8byte)  varptr(st)+88 を基点に操作(8byte:入れ子/配列)
; szlPhysSize : SIZE (+96, 8byte)  varptr(st)+96 を基点に操作(8byte:入れ子/配列)
; ulNumPalReg : DWORD (+104, 4byte)  st.26 = 値  /  値 = st.26   (lpoke/lpeek も可)
; ciDevice : COLORINFO (+108, 120byte)  varptr(st)+108 を基点に操作(120byte:入れ子/配列)
; ulDevicePelsDPI : DWORD (+228, 4byte)  st.57 = 値  /  値 = st.57   (lpoke/lpeek も可)
; ulPrimaryOrder : DWORD (+232, 4byte)  st.58 = 値  /  値 = st.58   (lpoke/lpeek も可)
; ulHTPatternSize : DWORD (+236, 4byte)  st.59 = 値  /  値 = st.59   (lpoke/lpeek も可)
; ulHTOutputFormat : DWORD (+240, 4byte)  st.60 = 値  /  値 = st.60   (lpoke/lpeek も可)
; flHTFlags : DWORD (+244, 4byte)  st.61 = 値  /  値 = st.61   (lpoke/lpeek も可)
; ulVRefresh : DWORD (+248, 4byte)  st.62 = 値  /  値 = st.62   (lpoke/lpeek も可)
; ulBltAlignment : DWORD (+252, 4byte)  st.63 = 値  /  値 = st.63   (lpoke/lpeek も可)
; ulPanningHorzRes : DWORD (+256, 4byte)  st.64 = 値  /  値 = st.64   (lpoke/lpeek も可)
; ulPanningVertRes : DWORD (+260, 4byte)  st.65 = 値  /  値 = st.65   (lpoke/lpeek も可)
; xPanningAlignment : DWORD (+264, 4byte)  st.66 = 値  /  値 = st.66   (lpoke/lpeek も可)
; yPanningAlignment : DWORD (+268, 4byte)  st.67 = 値  /  値 = st.67   (lpoke/lpeek も可)
; cxHTPat : DWORD (+272, 4byte)  st.68 = 値  /  値 = st.68   (lpoke/lpeek も可)
; cyHTPat : DWORD (+276, 4byte)  st.69 = 値  /  値 = st.69   (lpoke/lpeek も可)
; pHTPatA : BYTE* (+280, 4byte)  st.70 = 値  /  値 = st.70   (lpoke/lpeek も可)
; pHTPatB : BYTE* (+284, 4byte)  st.71 = 値  /  値 = st.71   (lpoke/lpeek も可)
; pHTPatC : BYTE* (+288, 4byte)  st.72 = 値  /  値 = st.72   (lpoke/lpeek も可)
; flShadeBlend : DWORD (+292, 4byte)  st.73 = 値  /  値 = st.73   (lpoke/lpeek も可)
; ulPhysicalPixelCharacteristics : DWORD (+296, 4byte)  st.74 = 値  /  値 = st.74   (lpoke/lpeek も可)
; ulPhysicalPixelGamma : DWORD (+300, 4byte)  st.75 = 値  /  値 = st.75   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; GDIINFO サイズ: 320 バイト(x64)
dim st, 80    ; 4byte整数×80(構造体サイズ 320 / 4 切り上げ)
; ulVersion : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; ulTechnology : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; ulHorzSize : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; ulVertSize : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; ulHorzRes : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; ulVertRes : DWORD (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; cBitsPixel : DWORD (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; cPlanes : DWORD (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; ulNumColors : DWORD (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; flRaster : DWORD (+36, 4byte)  st.9 = 値  /  値 = st.9   (lpoke/lpeek も可)
; ulLogPixelsX : DWORD (+40, 4byte)  st.10 = 値  /  値 = st.10   (lpoke/lpeek も可)
; ulLogPixelsY : DWORD (+44, 4byte)  st.11 = 値  /  値 = st.11   (lpoke/lpeek も可)
; flTextCaps : DWORD (+48, 4byte)  st.12 = 値  /  値 = st.12   (lpoke/lpeek も可)
; ulDACRed : DWORD (+52, 4byte)  st.13 = 値  /  値 = st.13   (lpoke/lpeek も可)
; ulDACGreen : DWORD (+56, 4byte)  st.14 = 値  /  値 = st.14   (lpoke/lpeek も可)
; ulDACBlue : DWORD (+60, 4byte)  st.15 = 値  /  値 = st.15   (lpoke/lpeek も可)
; ulAspectX : DWORD (+64, 4byte)  st.16 = 値  /  値 = st.16   (lpoke/lpeek も可)
; ulAspectY : DWORD (+68, 4byte)  st.17 = 値  /  値 = st.17   (lpoke/lpeek も可)
; ulAspectXY : DWORD (+72, 4byte)  st.18 = 値  /  値 = st.18   (lpoke/lpeek も可)
; xStyleStep : INT (+76, 4byte)  st.19 = 値  /  値 = st.19   (lpoke/lpeek も可)
; yStyleStep : INT (+80, 4byte)  st.20 = 値  /  値 = st.20   (lpoke/lpeek も可)
; denStyleStep : INT (+84, 4byte)  st.21 = 値  /  値 = st.21   (lpoke/lpeek も可)
; ptlPhysOffset : POINTL (+88, 8byte)  varptr(st)+88 を基点に操作(8byte:入れ子/配列)
; szlPhysSize : SIZE (+96, 8byte)  varptr(st)+96 を基点に操作(8byte:入れ子/配列)
; ulNumPalReg : DWORD (+104, 4byte)  st.26 = 値  /  値 = st.26   (lpoke/lpeek も可)
; ciDevice : COLORINFO (+108, 120byte)  varptr(st)+108 を基点に操作(120byte:入れ子/配列)
; ulDevicePelsDPI : DWORD (+228, 4byte)  st.57 = 値  /  値 = st.57   (lpoke/lpeek も可)
; ulPrimaryOrder : DWORD (+232, 4byte)  st.58 = 値  /  値 = st.58   (lpoke/lpeek も可)
; ulHTPatternSize : DWORD (+236, 4byte)  st.59 = 値  /  値 = st.59   (lpoke/lpeek も可)
; ulHTOutputFormat : DWORD (+240, 4byte)  st.60 = 値  /  値 = st.60   (lpoke/lpeek も可)
; flHTFlags : DWORD (+244, 4byte)  st.61 = 値  /  値 = st.61   (lpoke/lpeek も可)
; ulVRefresh : DWORD (+248, 4byte)  st.62 = 値  /  値 = st.62   (lpoke/lpeek も可)
; ulBltAlignment : DWORD (+252, 4byte)  st.63 = 値  /  値 = st.63   (lpoke/lpeek も可)
; ulPanningHorzRes : DWORD (+256, 4byte)  st.64 = 値  /  値 = st.64   (lpoke/lpeek も可)
; ulPanningVertRes : DWORD (+260, 4byte)  st.65 = 値  /  値 = st.65   (lpoke/lpeek も可)
; xPanningAlignment : DWORD (+264, 4byte)  st.66 = 値  /  値 = st.66   (lpoke/lpeek も可)
; yPanningAlignment : DWORD (+268, 4byte)  st.67 = 値  /  値 = st.67   (lpoke/lpeek も可)
; cxHTPat : DWORD (+272, 4byte)  st.68 = 値  /  値 = st.68   (lpoke/lpeek も可)
; cyHTPat : DWORD (+276, 4byte)  st.69 = 値  /  値 = st.69   (lpoke/lpeek も可)
; pHTPatA : BYTE* (+280, 8byte)  qpoke st,280,値 / qpeek(st,280)  ※IronHSPのみ。3.7/3.8は lpoke st,280,下位 : lpoke st,284,上位
; pHTPatB : BYTE* (+288, 8byte)  qpoke st,288,値 / qpeek(st,288)  ※IronHSPのみ。3.7/3.8は lpoke st,288,下位 : lpoke st,292,上位
; pHTPatC : BYTE* (+296, 8byte)  qpoke st,296,値 / qpeek(st,296)  ※IronHSPのみ。3.7/3.8は lpoke st,296,下位 : lpoke st,300,上位
; flShadeBlend : DWORD (+304, 4byte)  st.76 = 値  /  値 = st.76   (lpoke/lpeek も可)
; ulPhysicalPixelCharacteristics : DWORD (+308, 4byte)  st.77 = 値  /  値 = st.77   (lpoke/lpeek も可)
; ulPhysicalPixelGamma : DWORD (+312, 4byte)  st.78 = 値  /  値 = st.78   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global POINTL
    #field int x
    #field int y
#endstruct

#defstruct global SIZE
    #field int cx
    #field int cy
#endstruct

#defstruct global CIECHROMA
    #field int x
    #field int y
    #field int Y
#endstruct

#defstruct global COLORINFO
    #field CIECHROMA Red
    #field CIECHROMA Green
    #field CIECHROMA Blue
    #field CIECHROMA Cyan
    #field CIECHROMA Magenta
    #field CIECHROMA Yellow
    #field CIECHROMA AlignmentWhite
    #field int RedGamma
    #field int GreenGamma
    #field int BlueGamma
    #field int MagentaInCyanDye
    #field int YellowInCyanDye
    #field int CyanInMagentaDye
    #field int YellowInMagentaDye
    #field int CyanInYellowDye
    #field int MagentaInYellowDye
#endstruct

#defstruct global GDIINFO
    #field int ulVersion
    #field int ulTechnology
    #field int ulHorzSize
    #field int ulVertSize
    #field int ulHorzRes
    #field int ulVertRes
    #field int cBitsPixel
    #field int cPlanes
    #field int ulNumColors
    #field int flRaster
    #field int ulLogPixelsX
    #field int ulLogPixelsY
    #field int flTextCaps
    #field int ulDACRed
    #field int ulDACGreen
    #field int ulDACBlue
    #field int ulAspectX
    #field int ulAspectY
    #field int ulAspectXY
    #field int xStyleStep
    #field int yStyleStep
    #field int denStyleStep
    #field POINTL ptlPhysOffset
    #field SIZE szlPhysSize
    #field int ulNumPalReg
    #field COLORINFO ciDevice
    #field int ulDevicePelsDPI
    #field int ulPrimaryOrder
    #field int ulHTPatternSize
    #field int ulHTOutputFormat
    #field int flHTFlags
    #field int ulVRefresh
    #field int ulBltAlignment
    #field int ulPanningHorzRes
    #field int ulPanningVertRes
    #field int xPanningAlignment
    #field int yPanningAlignment
    #field int cxHTPat
    #field int cyHTPat
    #field intptr pHTPatA
    #field intptr pHTPatB
    #field intptr pHTPatC
    #field int flShadeBlend
    #field int ulPhysicalPixelCharacteristics
    #field int ulPhysicalPixelGamma
#endstruct

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