ホーム › Graphics.Dxgi › DXGI_OUTDUPL_DESC
DXGI_OUTDUPL_DESC
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| ModeDesc | DXGI_MODE_DESC | 28 | +0 | +0 | 複製対象出力の表示モードを表すDXGI_MODE_DESC。 |
| Rotation | DXGI_MODE_ROTATION | 4 | +28 | +28 | デスクトップ画像の回転状態を示す列挙値。 |
| DesktopImageInSystemMemory | BOOL | 4 | +32 | +32 | デスクトップ画像がシステムメモリ上にあるかを示すブール値。 |
各言語での定義
#include <windows.h>
// DXGI_RATIONAL (x64 8 / x86 8 バイト)
typedef struct DXGI_RATIONAL {
DWORD Numerator;
DWORD Denominator;
} DXGI_RATIONAL;
// DXGI_MODE_DESC (x64 28 / x86 28 バイト)
typedef struct DXGI_MODE_DESC {
DWORD Width;
DWORD Height;
DXGI_RATIONAL RefreshRate;
DXGI_FORMAT Format;
DXGI_MODE_SCANLINE_ORDER ScanlineOrdering;
DXGI_MODE_SCALING Scaling;
} DXGI_MODE_DESC;
// DXGI_OUTDUPL_DESC (x64 36 / x86 36 バイト)
typedef struct DXGI_OUTDUPL_DESC {
DXGI_MODE_DESC ModeDesc;
DXGI_MODE_ROTATION Rotation;
BOOL DesktopImageInSystemMemory;
} DXGI_OUTDUPL_DESC;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DXGI_RATIONAL
{
public uint Numerator;
public uint Denominator;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DXGI_MODE_DESC
{
public uint Width;
public uint Height;
public DXGI_RATIONAL RefreshRate;
public int Format;
public int ScanlineOrdering;
public int Scaling;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DXGI_OUTDUPL_DESC
{
public DXGI_MODE_DESC ModeDesc;
public int Rotation;
[MarshalAs(UnmanagedType.Bool)] public bool DesktopImageInSystemMemory;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DXGI_RATIONAL
Public Numerator As UInteger
Public Denominator As UInteger
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DXGI_MODE_DESC
Public Width As UInteger
Public Height As UInteger
Public RefreshRate As DXGI_RATIONAL
Public Format As Integer
Public ScanlineOrdering As Integer
Public Scaling As Integer
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DXGI_OUTDUPL_DESC
Public ModeDesc As DXGI_MODE_DESC
Public Rotation As Integer
<MarshalAs(UnmanagedType.Bool)> Public DesktopImageInSystemMemory As Boolean
End Structureimport ctypes
from ctypes import wintypes
class DXGI_RATIONAL(ctypes.Structure):
_fields_ = [
("Numerator", wintypes.DWORD),
("Denominator", wintypes.DWORD),
]
class DXGI_MODE_DESC(ctypes.Structure):
_fields_ = [
("Width", wintypes.DWORD),
("Height", wintypes.DWORD),
("RefreshRate", DXGI_RATIONAL),
("Format", ctypes.c_int),
("ScanlineOrdering", ctypes.c_int),
("Scaling", ctypes.c_int),
]
class DXGI_OUTDUPL_DESC(ctypes.Structure):
_fields_ = [
("ModeDesc", DXGI_MODE_DESC),
("Rotation", ctypes.c_int),
("DesktopImageInSystemMemory", wintypes.BOOL),
]#[repr(C)]
pub struct DXGI_RATIONAL {
pub Numerator: u32,
pub Denominator: u32,
}
#[repr(C)]
pub struct DXGI_MODE_DESC {
pub Width: u32,
pub Height: u32,
pub RefreshRate: DXGI_RATIONAL,
pub Format: i32,
pub ScanlineOrdering: i32,
pub Scaling: i32,
}
#[repr(C)]
pub struct DXGI_OUTDUPL_DESC {
pub ModeDesc: DXGI_MODE_DESC,
pub Rotation: i32,
pub DesktopImageInSystemMemory: i32,
}import "golang.org/x/sys/windows"
type DXGI_RATIONAL struct {
Numerator uint32
Denominator uint32
}
type DXGI_MODE_DESC struct {
Width uint32
Height uint32
RefreshRate DXGI_RATIONAL
Format int32
ScanlineOrdering int32
Scaling int32
}
type DXGI_OUTDUPL_DESC struct {
ModeDesc DXGI_MODE_DESC
Rotation int32
DesktopImageInSystemMemory int32
}type
DXGI_RATIONAL = record
Numerator: DWORD;
Denominator: DWORD;
end;
DXGI_MODE_DESC = record
Width: DWORD;
Height: DWORD;
RefreshRate: DXGI_RATIONAL;
Format: Integer;
ScanlineOrdering: Integer;
Scaling: Integer;
end;
DXGI_OUTDUPL_DESC = record
ModeDesc: DXGI_MODE_DESC;
Rotation: Integer;
DesktopImageInSystemMemory: BOOL;
end;const DXGI_RATIONAL = extern struct {
Numerator: u32,
Denominator: u32,
};
const DXGI_MODE_DESC = extern struct {
Width: u32,
Height: u32,
RefreshRate: DXGI_RATIONAL,
Format: i32,
ScanlineOrdering: i32,
Scaling: i32,
};
const DXGI_OUTDUPL_DESC = extern struct {
ModeDesc: DXGI_MODE_DESC,
Rotation: i32,
DesktopImageInSystemMemory: i32,
};type
DXGI_RATIONAL {.bycopy.} = object
Numerator: uint32
Denominator: uint32
DXGI_MODE_DESC {.bycopy.} = object
Width: uint32
Height: uint32
RefreshRate: DXGI_RATIONAL
Format: int32
ScanlineOrdering: int32
Scaling: int32
DXGI_OUTDUPL_DESC {.bycopy.} = object
ModeDesc: DXGI_MODE_DESC
Rotation: int32
DesktopImageInSystemMemory: int32struct DXGI_RATIONAL
{
uint Numerator;
uint Denominator;
}
struct DXGI_MODE_DESC
{
uint Width;
uint Height;
DXGI_RATIONAL RefreshRate;
int Format;
int ScanlineOrdering;
int Scaling;
}
struct DXGI_OUTDUPL_DESC
{
DXGI_MODE_DESC ModeDesc;
int Rotation;
int DesktopImageInSystemMemory;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DXGI_OUTDUPL_DESC サイズ: 36 バイト(x64)
dim st, 9 ; 4byte整数×9(構造体サイズ 36 / 4 切り上げ)
; ModeDesc : DXGI_MODE_DESC (+0, 28byte) varptr(st)+0 を基点に操作(28byte:入れ子/配列)
; Rotation : DXGI_MODE_ROTATION (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; DesktopImageInSystemMemory : BOOL (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global DXGI_RATIONAL
#field int Numerator
#field int Denominator
#endstruct
#defstruct global DXGI_MODE_DESC
#field int Width
#field int Height
#field DXGI_RATIONAL RefreshRate
#field int Format
#field int ScanlineOrdering
#field int Scaling
#endstruct
#defstruct global DXGI_OUTDUPL_DESC
#field DXGI_MODE_DESC ModeDesc
#field int Rotation
#field bool DesktopImageInSystemMemory
#endstruct
stdim st, DXGI_OUTDUPL_DESC ; NSTRUCT 変数を確保
st->Rotation = 100
mes "Rotation=" + st->Rotation