ホーム › UI.TabletPC › INKMETRIC
INKMETRIC
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| iHeight | INT | 4 | +0 | +0 | インクの高さ(サイズ)を示す値。 |
| iFontAscent | INT | 4 | +4 | +4 | 対応フォントのアセント(基線より上)の高さ。 |
| iFontDescent | INT | 4 | +8 | +8 | 対応フォントのディセント(基線より下)の高さ。 |
| dwFlags | DWORD | 4 | +12 | +12 | インクメトリクスの特性を示すフラグ群。 |
| color | COLORREF | 4 | +16 | +16 | インクの色(COLORREF)。 |
各言語での定義
#include <windows.h>
// INKMETRIC (x64 20 / x86 20 バイト)
typedef struct INKMETRIC {
INT iHeight;
INT iFontAscent;
INT iFontDescent;
DWORD dwFlags;
COLORREF color;
} INKMETRIC;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct INKMETRIC
{
public int iHeight;
public int iFontAscent;
public int iFontDescent;
public uint dwFlags;
public uint color;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure INKMETRIC
Public iHeight As Integer
Public iFontAscent As Integer
Public iFontDescent As Integer
Public dwFlags As UInteger
Public color As UInteger
End Structureimport ctypes
from ctypes import wintypes
class INKMETRIC(ctypes.Structure):
_fields_ = [
("iHeight", ctypes.c_int),
("iFontAscent", ctypes.c_int),
("iFontDescent", ctypes.c_int),
("dwFlags", wintypes.DWORD),
("color", wintypes.DWORD),
]#[repr(C)]
pub struct INKMETRIC {
pub iHeight: i32,
pub iFontAscent: i32,
pub iFontDescent: i32,
pub dwFlags: u32,
pub color: u32,
}import "golang.org/x/sys/windows"
type INKMETRIC struct {
iHeight int32
iFontAscent int32
iFontDescent int32
dwFlags uint32
color uint32
}type
INKMETRIC = record
iHeight: Integer;
iFontAscent: Integer;
iFontDescent: Integer;
dwFlags: DWORD;
color: DWORD;
end;const INKMETRIC = extern struct {
iHeight: i32,
iFontAscent: i32,
iFontDescent: i32,
dwFlags: u32,
color: u32,
};type
INKMETRIC {.bycopy.} = object
iHeight: int32
iFontAscent: int32
iFontDescent: int32
dwFlags: uint32
color: uint32struct INKMETRIC
{
int iHeight;
int iFontAscent;
int iFontDescent;
uint dwFlags;
uint color;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; INKMETRIC サイズ: 20 バイト(x64)
dim st, 5 ; 4byte整数×5(構造体サイズ 20 / 4 切り上げ)
; iHeight : INT (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; iFontAscent : INT (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; iFontDescent : INT (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; dwFlags : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; color : COLORREF (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global INKMETRIC
#field int iHeight
#field int iFontAscent
#field int iFontDescent
#field int dwFlags
#field int color
#endstruct
stdim st, INKMETRIC ; NSTRUCT 変数を確保
st->iHeight = 100
mes "iHeight=" + st->iHeight