ホーム › Graphics.Gdi › POINTFX
POINTFX
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| x | FIXED | 4 | +0 | +0 | TrueType 文字の輪郭上にある点の x 成分です。 |
| y | FIXED | 4 | +4 | +4 | TrueType 文字の輪郭上にある点の y 成分です。 |
公式ドキュメント
POINTFX 構造体は、TrueType フォントの文字の輪郭を表す点の座標を格納します。
解説(Remarks)
POINTFX 構造体は、TTPOLYCURVE 構造体および TTPOLYGONHEADER 構造体のメンバーです。POINTFX 構造体の値はデバイス単位で指定します。
出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
各言語での定義
#include <windows.h>
// FIXED (x64 4 / x86 4 バイト)
typedef struct FIXED {
WORD fract;
SHORT value;
} FIXED;
// POINTFX (x64 8 / x86 8 バイト)
typedef struct POINTFX {
FIXED x;
FIXED y;
} POINTFX;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct FIXED
{
public ushort fract;
public short value;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct POINTFX
{
public FIXED x;
public FIXED y;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure FIXED
Public fract As UShort
Public value As Short
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure POINTFX
Public x As FIXED
Public y As FIXED
End Structureimport ctypes
from ctypes import wintypes
class FIXED(ctypes.Structure):
_fields_ = [
("fract", ctypes.c_ushort),
("value", ctypes.c_short),
]
class POINTFX(ctypes.Structure):
_fields_ = [
("x", FIXED),
("y", FIXED),
]#[repr(C)]
pub struct FIXED {
pub fract: u16,
pub value: i16,
}
#[repr(C)]
pub struct POINTFX {
pub x: FIXED,
pub y: FIXED,
}import "golang.org/x/sys/windows"
type FIXED struct {
fract uint16
value int16
}
type POINTFX struct {
x FIXED
y FIXED
}type
FIXED = record
fract: Word;
value: Smallint;
end;
POINTFX = record
x: FIXED;
y: FIXED;
end;const FIXED = extern struct {
fract: u16,
value: i16,
};
const POINTFX = extern struct {
x: FIXED,
y: FIXED,
};type
FIXED {.bycopy.} = object
fract: uint16
value: int16
POINTFX {.bycopy.} = object
x: FIXED
y: FIXEDstruct FIXED
{
ushort fract;
short value;
}
struct POINTFX
{
FIXED x;
FIXED y;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; POINTFX サイズ: 8 バイト(x64)
dim st, 2 ; 4byte整数×2(構造体サイズ 8 / 4 切り上げ)
; x : FIXED (+0, 4byte) varptr(st)+0 を基点に操作(4byte:入れ子/配列)
; y : FIXED (+4, 4byte) varptr(st)+4 を基点に操作(4byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global FIXED
#field short fract
#field short value
#endstruct
#defstruct global POINTFX
#field FIXED x
#field FIXED y
#endstruct
stdim st, POINTFX ; NSTRUCT 変数を確保