Win32 API 日本語リファレンス
ホームGraphics.DirectWrite › DWRITE_OVERHANG_METRICS

DWRITE_OVERHANG_METRICS

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

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

フィールド

フィールドサイズx64x86説明
leftFLOAT4+0+0レイアウト矩形の左端からはみ出した量。正の値ではみ出しを表す。
topFLOAT4+4+4レイアウト矩形の上端からはみ出した量。正の値ではみ出しを表す。
rightFLOAT4+8+8レイアウト矩形の右端からはみ出した量。正の値ではみ出しを表す。
bottomFLOAT4+12+12レイアウト矩形の下端からはみ出した量。正の値ではみ出しを表す。

各言語での定義

#include <windows.h>

// DWRITE_OVERHANG_METRICS  (x64 16 / x86 16 バイト)
typedef struct DWRITE_OVERHANG_METRICS {
    FLOAT left;
    FLOAT top;
    FLOAT right;
    FLOAT bottom;
} DWRITE_OVERHANG_METRICS;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DWRITE_OVERHANG_METRICS
{
    public float left;
    public float top;
    public float right;
    public float bottom;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DWRITE_OVERHANG_METRICS
    Public left As Single
    Public top As Single
    Public right As Single
    Public bottom As Single
End Structure
import ctypes
from ctypes import wintypes

class DWRITE_OVERHANG_METRICS(ctypes.Structure):
    _fields_ = [
        ("left", ctypes.c_float),
        ("top", ctypes.c_float),
        ("right", ctypes.c_float),
        ("bottom", ctypes.c_float),
    ]
#[repr(C)]
pub struct DWRITE_OVERHANG_METRICS {
    pub left: f32,
    pub top: f32,
    pub right: f32,
    pub bottom: f32,
}
import "golang.org/x/sys/windows"

type DWRITE_OVERHANG_METRICS struct {
	left float32
	top float32
	right float32
	bottom float32
}
type
  DWRITE_OVERHANG_METRICS = record
    left: Single;
    top: Single;
    right: Single;
    bottom: Single;
  end;
const DWRITE_OVERHANG_METRICS = extern struct {
    left: f32,
    top: f32,
    right: f32,
    bottom: f32,
};
type
  DWRITE_OVERHANG_METRICS {.bycopy.} = object
    left: float32
    top: float32
    right: float32
    bottom: float32
struct DWRITE_OVERHANG_METRICS
{
    float left;
    float top;
    float right;
    float bottom;
}

HSP用 定義

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

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

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