ホーム › Media.DirectShow › NORMALIZEDRECT
NORMALIZEDRECT
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| left | FLOAT | 4 | +0 | +0 | 正規化された左端座標を0から1の範囲で示す。 |
| top | FLOAT | 4 | +4 | +4 | 正規化された上端座標を0から1の範囲で示す。 |
| right | FLOAT | 4 | +8 | +8 | 正規化された右端座標を0から1の範囲で示す。 |
| bottom | FLOAT | 4 | +12 | +12 | 正規化された下端座標を0から1の範囲で示す。 |
各言語での定義
#include <windows.h>
// NORMALIZEDRECT (x64 16 / x86 16 バイト)
typedef struct NORMALIZEDRECT {
FLOAT left;
FLOAT top;
FLOAT right;
FLOAT bottom;
} NORMALIZEDRECT;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct NORMALIZEDRECT
{
public float left;
public float top;
public float right;
public float bottom;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure NORMALIZEDRECT
Public left As Single
Public top As Single
Public right As Single
Public bottom As Single
End Structureimport ctypes
from ctypes import wintypes
class NORMALIZEDRECT(ctypes.Structure):
_fields_ = [
("left", ctypes.c_float),
("top", ctypes.c_float),
("right", ctypes.c_float),
("bottom", ctypes.c_float),
]#[repr(C)]
pub struct NORMALIZEDRECT {
pub left: f32,
pub top: f32,
pub right: f32,
pub bottom: f32,
}import "golang.org/x/sys/windows"
type NORMALIZEDRECT struct {
left float32
top float32
right float32
bottom float32
}type
NORMALIZEDRECT = record
left: Single;
top: Single;
right: Single;
bottom: Single;
end;const NORMALIZEDRECT = extern struct {
left: f32,
top: f32,
right: f32,
bottom: f32,
};type
NORMALIZEDRECT {.bycopy.} = object
left: float32
top: float32
right: float32
bottom: float32struct NORMALIZEDRECT
{
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 レイアウト)
; NORMALIZEDRECT サイズ: 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 NORMALIZEDRECT
#field float left
#field float top
#field float right
#field float bottom
#endstruct
stdim st, NORMALIZEDRECT ; NSTRUCT 変数を確保
st->left = 100
mes "left=" + st->left