ホーム › Graphics.GdiPlus › EncoderParameter
EncoderParameter
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| Guid | GUID | 16 | +0 | +0 | エンコーダパラメータの種類を識別するGUID。 |
| NumberOfValues | DWORD | 4 | +16 | +16 | Valueに含まれる値の個数を表す。 |
| Type | DWORD | 4 | +20 | +20 | パラメータ値のデータ型を表す。EncoderParameterValueType列挙値。 |
| Value | void* | 8/4 | +24 | +24 | パラメータ値の配列へのポインタ。 |
各言語での定義
#include <windows.h>
// EncoderParameter (x64 32 / x86 28 バイト)
typedef struct EncoderParameter {
GUID Guid;
DWORD NumberOfValues;
DWORD Type;
void* Value;
} EncoderParameter;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct EncoderParameter
{
public Guid Guid;
public uint NumberOfValues;
public uint Type;
public IntPtr Value;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure EncoderParameter
Public Guid As Guid
Public NumberOfValues As UInteger
Public Type As UInteger
Public Value As IntPtr
End Structureimport ctypes
from ctypes import wintypes
class EncoderParameter(ctypes.Structure):
_fields_ = [
("Guid", GUID),
("NumberOfValues", wintypes.DWORD),
("Type", wintypes.DWORD),
("Value", ctypes.c_void_p),
]#[repr(C)]
pub struct EncoderParameter {
pub Guid: GUID,
pub NumberOfValues: u32,
pub Type: u32,
pub Value: *mut core::ffi::c_void,
}import "golang.org/x/sys/windows"
type EncoderParameter struct {
Guid windows.GUID
NumberOfValues uint32
Type uint32
Value uintptr
}type
EncoderParameter = record
Guid: TGUID;
NumberOfValues: DWORD;
Type: DWORD;
Value: Pointer;
end;const EncoderParameter = extern struct {
Guid: GUID,
NumberOfValues: u32,
Type: u32,
Value: ?*anyopaque,
};type
EncoderParameter {.bycopy.} = object
Guid: GUID
NumberOfValues: uint32
Type: uint32
Value: pointerstruct EncoderParameter
{
GUID Guid;
uint NumberOfValues;
uint Type;
void* Value;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; EncoderParameter サイズ: 28 バイト(x86)
dim st, 7 ; 4byte整数×7(構造体サイズ 28 / 4 切り上げ)
; Guid : GUID (+0, 16byte) varptr(st)+0 を基点に操作(16byte:入れ子/配列)
; NumberOfValues : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; Type : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; Value : void* (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; EncoderParameter サイズ: 32 バイト(x64)
dim st, 8 ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; Guid : GUID (+0, 16byte) varptr(st)+0 を基点に操作(16byte:入れ子/配列)
; NumberOfValues : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; Type : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; Value : void* (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global GUID, pack=1
#field int Data1
#field short Data2
#field short Data3
#field byte Data4 8
#endstruct
#defstruct global EncoderParameter
#field GUID Guid
#field int NumberOfValues
#field int Type
#field intptr Value
#endstruct
stdim st, EncoderParameter ; NSTRUCT 変数を確保
st->NumberOfValues = 100
mes "NumberOfValues=" + st->NumberOfValues