ホーム › Devices.Display › VIDEO_MODE_INFORMATION
VIDEO_MODE_INFORMATION
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| Length | DWORD | 4 | +0 | +0 | この構造体のバイト長。 |
| ModeIndex | DWORD | 4 | +4 | +4 | このモードを識別するインデックス。 |
| VisScreenWidth | DWORD | 4 | +8 | +8 | 可視画面の幅(ピクセル)。 |
| VisScreenHeight | DWORD | 4 | +12 | +12 | 可視画面の高さ(ピクセル)。 |
| ScreenStride | DWORD | 4 | +16 | +16 | 1スキャンラインのバイト数(ストライド)。 |
| NumberOfPlanes | DWORD | 4 | +20 | +20 | カラープレーン数。 |
| BitsPerPlane | DWORD | 4 | +24 | +24 | プレーンあたりのビット数。 |
| Frequency | DWORD | 4 | +28 | +28 | 垂直リフレッシュレート(Hz)。 |
| XMillimeter | DWORD | 4 | +32 | +32 | 画面の物理的横幅(ミリメートル)。 |
| YMillimeter | DWORD | 4 | +36 | +36 | 画面の物理的縦幅(ミリメートル)。 |
| NumberRedBits | DWORD | 4 | +40 | +40 | 赤成分のビット数。 |
| NumberGreenBits | DWORD | 4 | +44 | +44 | 緑成分のビット数。 |
| NumberBlueBits | DWORD | 4 | +48 | +48 | 青成分のビット数。 |
| RedMask | DWORD | 4 | +52 | +52 | 赤成分を抽出するビットマスク。 |
| GreenMask | DWORD | 4 | +56 | +56 | 緑成分を抽出するビットマスク。 |
| BlueMask | DWORD | 4 | +60 | +60 | 青成分を抽出するビットマスク。 |
| AttributeFlags | DWORD | 4 | +64 | +64 | モードの属性フラグ(カラー/グラフィックス等、VIDEO_MODE_*)。 |
| VideoMemoryBitmapWidth | DWORD | 4 | +68 | +68 | ビデオメモリ上のビットマップ幅。 |
| VideoMemoryBitmapHeight | DWORD | 4 | +72 | +72 | ビデオメモリ上のビットマップ高さ。 |
| DriverSpecificAttributeFlags | DWORD | 4 | +76 | +76 | ドライバ固有の属性フラグ。 |
各言語での定義
#include <windows.h>
// VIDEO_MODE_INFORMATION (x64 80 / x86 80 バイト)
typedef struct VIDEO_MODE_INFORMATION {
DWORD Length;
DWORD ModeIndex;
DWORD VisScreenWidth;
DWORD VisScreenHeight;
DWORD ScreenStride;
DWORD NumberOfPlanes;
DWORD BitsPerPlane;
DWORD Frequency;
DWORD XMillimeter;
DWORD YMillimeter;
DWORD NumberRedBits;
DWORD NumberGreenBits;
DWORD NumberBlueBits;
DWORD RedMask;
DWORD GreenMask;
DWORD BlueMask;
DWORD AttributeFlags;
DWORD VideoMemoryBitmapWidth;
DWORD VideoMemoryBitmapHeight;
DWORD DriverSpecificAttributeFlags;
} VIDEO_MODE_INFORMATION;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct VIDEO_MODE_INFORMATION
{
public uint Length;
public uint ModeIndex;
public uint VisScreenWidth;
public uint VisScreenHeight;
public uint ScreenStride;
public uint NumberOfPlanes;
public uint BitsPerPlane;
public uint Frequency;
public uint XMillimeter;
public uint YMillimeter;
public uint NumberRedBits;
public uint NumberGreenBits;
public uint NumberBlueBits;
public uint RedMask;
public uint GreenMask;
public uint BlueMask;
public uint AttributeFlags;
public uint VideoMemoryBitmapWidth;
public uint VideoMemoryBitmapHeight;
public uint DriverSpecificAttributeFlags;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure VIDEO_MODE_INFORMATION
Public Length As UInteger
Public ModeIndex As UInteger
Public VisScreenWidth As UInteger
Public VisScreenHeight As UInteger
Public ScreenStride As UInteger
Public NumberOfPlanes As UInteger
Public BitsPerPlane As UInteger
Public Frequency As UInteger
Public XMillimeter As UInteger
Public YMillimeter As UInteger
Public NumberRedBits As UInteger
Public NumberGreenBits As UInteger
Public NumberBlueBits As UInteger
Public RedMask As UInteger
Public GreenMask As UInteger
Public BlueMask As UInteger
Public AttributeFlags As UInteger
Public VideoMemoryBitmapWidth As UInteger
Public VideoMemoryBitmapHeight As UInteger
Public DriverSpecificAttributeFlags As UInteger
End Structureimport ctypes
from ctypes import wintypes
class VIDEO_MODE_INFORMATION(ctypes.Structure):
_fields_ = [
("Length", wintypes.DWORD),
("ModeIndex", wintypes.DWORD),
("VisScreenWidth", wintypes.DWORD),
("VisScreenHeight", wintypes.DWORD),
("ScreenStride", wintypes.DWORD),
("NumberOfPlanes", wintypes.DWORD),
("BitsPerPlane", wintypes.DWORD),
("Frequency", wintypes.DWORD),
("XMillimeter", wintypes.DWORD),
("YMillimeter", wintypes.DWORD),
("NumberRedBits", wintypes.DWORD),
("NumberGreenBits", wintypes.DWORD),
("NumberBlueBits", wintypes.DWORD),
("RedMask", wintypes.DWORD),
("GreenMask", wintypes.DWORD),
("BlueMask", wintypes.DWORD),
("AttributeFlags", wintypes.DWORD),
("VideoMemoryBitmapWidth", wintypes.DWORD),
("VideoMemoryBitmapHeight", wintypes.DWORD),
("DriverSpecificAttributeFlags", wintypes.DWORD),
]#[repr(C)]
pub struct VIDEO_MODE_INFORMATION {
pub Length: u32,
pub ModeIndex: u32,
pub VisScreenWidth: u32,
pub VisScreenHeight: u32,
pub ScreenStride: u32,
pub NumberOfPlanes: u32,
pub BitsPerPlane: u32,
pub Frequency: u32,
pub XMillimeter: u32,
pub YMillimeter: u32,
pub NumberRedBits: u32,
pub NumberGreenBits: u32,
pub NumberBlueBits: u32,
pub RedMask: u32,
pub GreenMask: u32,
pub BlueMask: u32,
pub AttributeFlags: u32,
pub VideoMemoryBitmapWidth: u32,
pub VideoMemoryBitmapHeight: u32,
pub DriverSpecificAttributeFlags: u32,
}import "golang.org/x/sys/windows"
type VIDEO_MODE_INFORMATION struct {
Length uint32
ModeIndex uint32
VisScreenWidth uint32
VisScreenHeight uint32
ScreenStride uint32
NumberOfPlanes uint32
BitsPerPlane uint32
Frequency uint32
XMillimeter uint32
YMillimeter uint32
NumberRedBits uint32
NumberGreenBits uint32
NumberBlueBits uint32
RedMask uint32
GreenMask uint32
BlueMask uint32
AttributeFlags uint32
VideoMemoryBitmapWidth uint32
VideoMemoryBitmapHeight uint32
DriverSpecificAttributeFlags uint32
}type
VIDEO_MODE_INFORMATION = record
Length: DWORD;
ModeIndex: DWORD;
VisScreenWidth: DWORD;
VisScreenHeight: DWORD;
ScreenStride: DWORD;
NumberOfPlanes: DWORD;
BitsPerPlane: DWORD;
Frequency: DWORD;
XMillimeter: DWORD;
YMillimeter: DWORD;
NumberRedBits: DWORD;
NumberGreenBits: DWORD;
NumberBlueBits: DWORD;
RedMask: DWORD;
GreenMask: DWORD;
BlueMask: DWORD;
AttributeFlags: DWORD;
VideoMemoryBitmapWidth: DWORD;
VideoMemoryBitmapHeight: DWORD;
DriverSpecificAttributeFlags: DWORD;
end;const VIDEO_MODE_INFORMATION = extern struct {
Length: u32,
ModeIndex: u32,
VisScreenWidth: u32,
VisScreenHeight: u32,
ScreenStride: u32,
NumberOfPlanes: u32,
BitsPerPlane: u32,
Frequency: u32,
XMillimeter: u32,
YMillimeter: u32,
NumberRedBits: u32,
NumberGreenBits: u32,
NumberBlueBits: u32,
RedMask: u32,
GreenMask: u32,
BlueMask: u32,
AttributeFlags: u32,
VideoMemoryBitmapWidth: u32,
VideoMemoryBitmapHeight: u32,
DriverSpecificAttributeFlags: u32,
};type
VIDEO_MODE_INFORMATION {.bycopy.} = object
Length: uint32
ModeIndex: uint32
VisScreenWidth: uint32
VisScreenHeight: uint32
ScreenStride: uint32
NumberOfPlanes: uint32
BitsPerPlane: uint32
Frequency: uint32
XMillimeter: uint32
YMillimeter: uint32
NumberRedBits: uint32
NumberGreenBits: uint32
NumberBlueBits: uint32
RedMask: uint32
GreenMask: uint32
BlueMask: uint32
AttributeFlags: uint32
VideoMemoryBitmapWidth: uint32
VideoMemoryBitmapHeight: uint32
DriverSpecificAttributeFlags: uint32struct VIDEO_MODE_INFORMATION
{
uint Length;
uint ModeIndex;
uint VisScreenWidth;
uint VisScreenHeight;
uint ScreenStride;
uint NumberOfPlanes;
uint BitsPerPlane;
uint Frequency;
uint XMillimeter;
uint YMillimeter;
uint NumberRedBits;
uint NumberGreenBits;
uint NumberBlueBits;
uint RedMask;
uint GreenMask;
uint BlueMask;
uint AttributeFlags;
uint VideoMemoryBitmapWidth;
uint VideoMemoryBitmapHeight;
uint DriverSpecificAttributeFlags;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; VIDEO_MODE_INFORMATION サイズ: 80 バイト(x64)
dim st, 20 ; 4byte整数×20(構造体サイズ 80 / 4 切り上げ)
; Length : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; ModeIndex : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; VisScreenWidth : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; VisScreenHeight : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; ScreenStride : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; NumberOfPlanes : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; BitsPerPlane : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; Frequency : DWORD (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; XMillimeter : DWORD (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; YMillimeter : DWORD (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; NumberRedBits : DWORD (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; NumberGreenBits : DWORD (+44, 4byte) st.11 = 値 / 値 = st.11 (lpoke/lpeek も可)
; NumberBlueBits : DWORD (+48, 4byte) st.12 = 値 / 値 = st.12 (lpoke/lpeek も可)
; RedMask : DWORD (+52, 4byte) st.13 = 値 / 値 = st.13 (lpoke/lpeek も可)
; GreenMask : DWORD (+56, 4byte) st.14 = 値 / 値 = st.14 (lpoke/lpeek も可)
; BlueMask : DWORD (+60, 4byte) st.15 = 値 / 値 = st.15 (lpoke/lpeek も可)
; AttributeFlags : DWORD (+64, 4byte) st.16 = 値 / 値 = st.16 (lpoke/lpeek も可)
; VideoMemoryBitmapWidth : DWORD (+68, 4byte) st.17 = 値 / 値 = st.17 (lpoke/lpeek も可)
; VideoMemoryBitmapHeight : DWORD (+72, 4byte) st.18 = 値 / 値 = st.18 (lpoke/lpeek も可)
; DriverSpecificAttributeFlags : DWORD (+76, 4byte) st.19 = 値 / 値 = st.19 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global VIDEO_MODE_INFORMATION
#field int Length
#field int ModeIndex
#field int VisScreenWidth
#field int VisScreenHeight
#field int ScreenStride
#field int NumberOfPlanes
#field int BitsPerPlane
#field int Frequency
#field int XMillimeter
#field int YMillimeter
#field int NumberRedBits
#field int NumberGreenBits
#field int NumberBlueBits
#field int RedMask
#field int GreenMask
#field int BlueMask
#field int AttributeFlags
#field int VideoMemoryBitmapWidth
#field int VideoMemoryBitmapHeight
#field int DriverSpecificAttributeFlags
#endstruct
stdim st, VIDEO_MODE_INFORMATION ; NSTRUCT 変数を確保
st->Length = 100
mes "Length=" + st->Length