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

VIDEO_LOAD_FONT_INFORMATION

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

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

フィールド

フィールドサイズx64x86説明
WidthInPixelsWORD2+0+0文字フォントの横幅(ピクセル)。
HeightInPixelsWORD2+2+2文字フォントの縦幅(ピクセル)。
FontSizeDWORD4+4+4フォントデータのバイトサイズ。
FontBYTE1+8+8フォントビットマップデータ(可変長バイト配列)。

各言語での定義

#include <windows.h>

// VIDEO_LOAD_FONT_INFORMATION  (x64 12 / x86 12 バイト)
typedef struct VIDEO_LOAD_FONT_INFORMATION {
    WORD WidthInPixels;
    WORD HeightInPixels;
    DWORD FontSize;
    BYTE Font[1];
} VIDEO_LOAD_FONT_INFORMATION;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct VIDEO_LOAD_FONT_INFORMATION
{
    public ushort WidthInPixels;
    public ushort HeightInPixels;
    public uint FontSize;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)] public byte[] Font;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure VIDEO_LOAD_FONT_INFORMATION
    Public WidthInPixels As UShort
    Public HeightInPixels As UShort
    Public FontSize As UInteger
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=1)> Public Font() As Byte
End Structure
import ctypes
from ctypes import wintypes

class VIDEO_LOAD_FONT_INFORMATION(ctypes.Structure):
    _fields_ = [
        ("WidthInPixels", ctypes.c_ushort),
        ("HeightInPixels", ctypes.c_ushort),
        ("FontSize", wintypes.DWORD),
        ("Font", ctypes.c_ubyte * 1),
    ]
#[repr(C)]
pub struct VIDEO_LOAD_FONT_INFORMATION {
    pub WidthInPixels: u16,
    pub HeightInPixels: u16,
    pub FontSize: u32,
    pub Font: [u8; 1],
}
import "golang.org/x/sys/windows"

type VIDEO_LOAD_FONT_INFORMATION struct {
	WidthInPixels uint16
	HeightInPixels uint16
	FontSize uint32
	Font [1]byte
}
type
  VIDEO_LOAD_FONT_INFORMATION = record
    WidthInPixels: Word;
    HeightInPixels: Word;
    FontSize: DWORD;
    Font: array[0..0] of Byte;
  end;
const VIDEO_LOAD_FONT_INFORMATION = extern struct {
    WidthInPixels: u16,
    HeightInPixels: u16,
    FontSize: u32,
    Font: [1]u8,
};
type
  VIDEO_LOAD_FONT_INFORMATION {.bycopy.} = object
    WidthInPixels: uint16
    HeightInPixels: uint16
    FontSize: uint32
    Font: array[1, uint8]
struct VIDEO_LOAD_FONT_INFORMATION
{
    ushort WidthInPixels;
    ushort HeightInPixels;
    uint FontSize;
    ubyte[1] Font;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; VIDEO_LOAD_FONT_INFORMATION サイズ: 12 バイト(x64)
dim st, 3    ; 4byte整数×3(構造体サイズ 12 / 4 切り上げ)
; WidthInPixels : WORD (+0, 2byte)  wpoke st,0,値  /  値 = wpeek(st,0)
; HeightInPixels : WORD (+2, 2byte)  wpoke st,2,値  /  値 = wpeek(st,2)
; FontSize : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; Font : BYTE (+8, 1byte)  varptr(st)+8 を基点に操作(1byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global VIDEO_LOAD_FONT_INFORMATION
    #field short WidthInPixels
    #field short HeightInPixels
    #field int FontSize
    #field byte Font 1
#endstruct

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