ホーム › Graphics.Gdi › EMRCOLORMATCHTOTARGET
EMRCOLORMATCHTOTARGET
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| emr | EMR | 8 | +0 | +0 | すべてのレコード型に共通する基本構造体です。 | ||||||||
| dwAction | DWORD | 4 | +8 | +8 | 実行するアクションです。このメンバーには、次のいずれかの値を指定できます。
| ||||||||
| dwFlags | DWORD | 4 | +12 | +12 | このパラメーターには、次の値を指定できます。
| ||||||||
| cbName | DWORD | 4 | +16 | +16 | 目的のターゲットプロファイル名のサイズ (バイト単位) です。 | ||||||||
| cbData | DWORD | 4 | +20 | +20 | ターゲットプロファイルの生データが添付されている場合の、そのデータのサイズ (バイト単位) です。 | ||||||||
| Data | BYTE | 1 | +24 | +24 | ターゲットプロファイル名とターゲットプロファイルの生データを格納する配列です。 配列のサイズは cbName + cbData です。 cbData が 0 以外の場合、ターゲットプロファイルの生データが添付されており、Data[cbName] の位置でターゲットプロファイル名の後に続きます。 |
公式ドキュメント
EMRCOLORMATCHTOTARGET 構造体には、ColorMatchToTarget 拡張メタファイルレコード用のメンバーが含まれます。
出典・ライセンス: 上記「公式ドキュメント」の内容は 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>
// EMR (x64 8 / x86 8 バイト)
typedef struct EMR {
ENHANCED_METAFILE_RECORD_TYPE iType;
DWORD nSize;
} EMR;
// EMRCOLORMATCHTOTARGET (x64 28 / x86 28 バイト)
typedef struct EMRCOLORMATCHTOTARGET {
EMR emr;
DWORD dwAction;
DWORD dwFlags;
DWORD cbName;
DWORD cbData;
BYTE Data[1];
} EMRCOLORMATCHTOTARGET;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct EMR
{
public uint iType;
public uint nSize;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct EMRCOLORMATCHTOTARGET
{
public EMR emr;
public uint dwAction;
public uint dwFlags;
public uint cbName;
public uint cbData;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)] public byte[] Data;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure EMR
Public iType As UInteger
Public nSize As UInteger
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure EMRCOLORMATCHTOTARGET
Public emr As EMR
Public dwAction As UInteger
Public dwFlags As UInteger
Public cbName As UInteger
Public cbData As UInteger
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=1)> Public Data() As Byte
End Structureimport ctypes
from ctypes import wintypes
class EMR(ctypes.Structure):
_fields_ = [
("iType", wintypes.DWORD),
("nSize", wintypes.DWORD),
]
class EMRCOLORMATCHTOTARGET(ctypes.Structure):
_fields_ = [
("emr", EMR),
("dwAction", wintypes.DWORD),
("dwFlags", wintypes.DWORD),
("cbName", wintypes.DWORD),
("cbData", wintypes.DWORD),
("Data", ctypes.c_ubyte * 1),
]#[repr(C)]
pub struct EMR {
pub iType: u32,
pub nSize: u32,
}
#[repr(C)]
pub struct EMRCOLORMATCHTOTARGET {
pub emr: EMR,
pub dwAction: u32,
pub dwFlags: u32,
pub cbName: u32,
pub cbData: u32,
pub Data: [u8; 1],
}import "golang.org/x/sys/windows"
type EMR struct {
iType uint32
nSize uint32
}
type EMRCOLORMATCHTOTARGET struct {
emr EMR
dwAction uint32
dwFlags uint32
cbName uint32
cbData uint32
Data [1]byte
}type
EMR = record
iType: DWORD;
nSize: DWORD;
end;
EMRCOLORMATCHTOTARGET = record
emr: EMR;
dwAction: DWORD;
dwFlags: DWORD;
cbName: DWORD;
cbData: DWORD;
Data: array[0..0] of Byte;
end;const EMR = extern struct {
iType: u32,
nSize: u32,
};
const EMRCOLORMATCHTOTARGET = extern struct {
emr: EMR,
dwAction: u32,
dwFlags: u32,
cbName: u32,
cbData: u32,
Data: [1]u8,
};type
EMR {.bycopy.} = object
iType: uint32
nSize: uint32
EMRCOLORMATCHTOTARGET {.bycopy.} = object
emr: EMR
dwAction: uint32
dwFlags: uint32
cbName: uint32
cbData: uint32
Data: array[1, uint8]struct EMR
{
uint iType;
uint nSize;
}
struct EMRCOLORMATCHTOTARGET
{
EMR emr;
uint dwAction;
uint dwFlags;
uint cbName;
uint cbData;
ubyte[1] Data;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; EMRCOLORMATCHTOTARGET サイズ: 28 バイト(x64)
dim st, 7 ; 4byte整数×7(構造体サイズ 28 / 4 切り上げ)
; emr : EMR (+0, 8byte) varptr(st)+0 を基点に操作(8byte:入れ子/配列)
; dwAction : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; dwFlags : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; cbName : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; cbData : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; Data : BYTE (+24, 1byte) varptr(st)+24 を基点に操作(1byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global EMR
#field int iType
#field int nSize
#endstruct
#defstruct global EMRCOLORMATCHTOTARGET
#field EMR emr
#field int dwAction
#field int dwFlags
#field int cbName
#field int cbData
#field byte Data 1
#endstruct
stdim st, EMRCOLORMATCHTOTARGET ; NSTRUCT 変数を確保
st->dwAction = 100
mes "dwAction=" + st->dwAction