ホーム › Media.KernelStreaming › KSMPEGVID_RECT
KSMPEGVID_RECT
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| StartX | DWORD | 4 | +0 | +0 | 矩形領域の左端X座標を示す。 |
| StartY | DWORD | 4 | +4 | +4 | 矩形領域の上端Y座標を示す。 |
| EndX | DWORD | 4 | +8 | +8 | 矩形領域の右端X座標を示す。 |
| EndY | DWORD | 4 | +12 | +12 | 矩形領域の下端Y座標を示す。 |
各言語での定義
#include <windows.h>
// KSMPEGVID_RECT (x64 16 / x86 16 バイト)
typedef struct KSMPEGVID_RECT {
DWORD StartX;
DWORD StartY;
DWORD EndX;
DWORD EndY;
} KSMPEGVID_RECT;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct KSMPEGVID_RECT
{
public uint StartX;
public uint StartY;
public uint EndX;
public uint EndY;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure KSMPEGVID_RECT
Public StartX As UInteger
Public StartY As UInteger
Public EndX As UInteger
Public EndY As UInteger
End Structureimport ctypes
from ctypes import wintypes
class KSMPEGVID_RECT(ctypes.Structure):
_fields_ = [
("StartX", wintypes.DWORD),
("StartY", wintypes.DWORD),
("EndX", wintypes.DWORD),
("EndY", wintypes.DWORD),
]#[repr(C)]
pub struct KSMPEGVID_RECT {
pub StartX: u32,
pub StartY: u32,
pub EndX: u32,
pub EndY: u32,
}import "golang.org/x/sys/windows"
type KSMPEGVID_RECT struct {
StartX uint32
StartY uint32
EndX uint32
EndY uint32
}type
KSMPEGVID_RECT = record
StartX: DWORD;
StartY: DWORD;
EndX: DWORD;
EndY: DWORD;
end;const KSMPEGVID_RECT = extern struct {
StartX: u32,
StartY: u32,
EndX: u32,
EndY: u32,
};type
KSMPEGVID_RECT {.bycopy.} = object
StartX: uint32
StartY: uint32
EndX: uint32
EndY: uint32struct KSMPEGVID_RECT
{
uint StartX;
uint StartY;
uint EndX;
uint EndY;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; KSMPEGVID_RECT サイズ: 16 バイト(x64)
dim st, 4 ; 4byte整数×4(構造体サイズ 16 / 4 切り上げ)
; StartX : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; StartY : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; EndX : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; EndY : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global KSMPEGVID_RECT
#field int StartX
#field int StartY
#field int EndX
#field int EndY
#endstruct
stdim st, KSMPEGVID_RECT ; NSTRUCT 変数を確保
st->StartX = 100
mes "StartX=" + st->StartX