ホーム › UI.Controls › IMAGELISTDRAWPARAMS
IMAGELISTDRAWPARAMS
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| cbSize | DWORD | 4 | +0 | +0 | この構造体のサイズをバイト単位で指定する。 |
| himl | HIMAGELIST | 8/4 | +8 | +4 | 描画対象画像を含むイメージリストのハンドル。 |
| i | INT | 4 | +16 | +8 | イメージリスト内で描画する画像のインデックス。 |
| hdcDst | HDC | 8/4 | +24 | +12 | 描画先のデバイスコンテキストのハンドル。 |
| x | INT | 4 | +32 | +16 | 描画先のX座標(hdcDst基準)。 |
| y | INT | 4 | +36 | +20 | 描画先のY座標(hdcDst基準)。 |
| cx | INT | 4 | +40 | +24 | 描画する画像の幅。0で全幅を使う。 |
| cy | INT | 4 | +44 | +28 | 描画する画像の高さ。0で全高を使う。 |
| xBitmap | INT | 4 | +48 | +32 | 画像内の描画開始X座標(オフセット)。 |
| yBitmap | INT | 4 | +52 | +36 | 画像内の描画開始Y座標(オフセット)。 |
| rgbBk | COLORREF | 4 | +56 | +40 | 背景色。CLR_NONEで透過、CLR_DEFAULTで既定色を使う。 |
| rgbFg | COLORREF | 4 | +60 | +44 | 前景色。マスク描画時に使われる。CLR_DEFAULT可。 |
| fStyle | DWORD | 4 | +64 | +48 | 描画スタイルを示すILD_系フラグの組み合わせ。 |
| dwRop | DWORD | 4 | +68 | +52 | CLR背景指定時に適用するラスタオペレーションコード。 |
| fState | DWORD | 4 | +72 | +56 | 描画エフェクトの状態を示すILS_系フラグ。 |
| Frame | DWORD | 4 | +76 | +60 | アルファブレンド係数、または描画フレーム番号。 |
| crEffect | COLORREF | 4 | +80 | +64 | 彩度/グローなどのエフェクトに使う色。COLORREF形式。 |
各言語での定義
#include <windows.h>
// IMAGELISTDRAWPARAMS (x64 88 / x86 68 バイト)
typedef struct IMAGELISTDRAWPARAMS {
DWORD cbSize;
HIMAGELIST himl;
INT i;
HDC hdcDst;
INT x;
INT y;
INT cx;
INT cy;
INT xBitmap;
INT yBitmap;
COLORREF rgbBk;
COLORREF rgbFg;
DWORD fStyle;
DWORD dwRop;
DWORD fState;
DWORD Frame;
COLORREF crEffect;
} IMAGELISTDRAWPARAMS;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct IMAGELISTDRAWPARAMS
{
public uint cbSize;
public IntPtr himl;
public int i;
public IntPtr hdcDst;
public int x;
public int y;
public int cx;
public int cy;
public int xBitmap;
public int yBitmap;
public uint rgbBk;
public uint rgbFg;
public uint fStyle;
public uint dwRop;
public uint fState;
public uint Frame;
public uint crEffect;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure IMAGELISTDRAWPARAMS
Public cbSize As UInteger
Public himl As IntPtr
Public i As Integer
Public hdcDst As IntPtr
Public x As Integer
Public y As Integer
Public cx As Integer
Public cy As Integer
Public xBitmap As Integer
Public yBitmap As Integer
Public rgbBk As UInteger
Public rgbFg As UInteger
Public fStyle As UInteger
Public dwRop As UInteger
Public fState As UInteger
Public Frame As UInteger
Public crEffect As UInteger
End Structureimport ctypes
from ctypes import wintypes
class IMAGELISTDRAWPARAMS(ctypes.Structure):
_fields_ = [
("cbSize", wintypes.DWORD),
("himl", ctypes.c_ssize_t),
("i", ctypes.c_int),
("hdcDst", ctypes.c_void_p),
("x", ctypes.c_int),
("y", ctypes.c_int),
("cx", ctypes.c_int),
("cy", ctypes.c_int),
("xBitmap", ctypes.c_int),
("yBitmap", ctypes.c_int),
("rgbBk", wintypes.DWORD),
("rgbFg", wintypes.DWORD),
("fStyle", wintypes.DWORD),
("dwRop", wintypes.DWORD),
("fState", wintypes.DWORD),
("Frame", wintypes.DWORD),
("crEffect", wintypes.DWORD),
]#[repr(C)]
pub struct IMAGELISTDRAWPARAMS {
pub cbSize: u32,
pub himl: isize,
pub i: i32,
pub hdcDst: *mut core::ffi::c_void,
pub x: i32,
pub y: i32,
pub cx: i32,
pub cy: i32,
pub xBitmap: i32,
pub yBitmap: i32,
pub rgbBk: u32,
pub rgbFg: u32,
pub fStyle: u32,
pub dwRop: u32,
pub fState: u32,
pub Frame: u32,
pub crEffect: u32,
}import "golang.org/x/sys/windows"
type IMAGELISTDRAWPARAMS struct {
cbSize uint32
himl uintptr
i int32
hdcDst uintptr
x int32
y int32
cx int32
cy int32
xBitmap int32
yBitmap int32
rgbBk uint32
rgbFg uint32
fStyle uint32
dwRop uint32
fState uint32
Frame uint32
crEffect uint32
}type
IMAGELISTDRAWPARAMS = record
cbSize: DWORD;
himl: NativeInt;
i: Integer;
hdcDst: Pointer;
x: Integer;
y: Integer;
cx: Integer;
cy: Integer;
xBitmap: Integer;
yBitmap: Integer;
rgbBk: DWORD;
rgbFg: DWORD;
fStyle: DWORD;
dwRop: DWORD;
fState: DWORD;
Frame: DWORD;
crEffect: DWORD;
end;const IMAGELISTDRAWPARAMS = extern struct {
cbSize: u32,
himl: isize,
i: i32,
hdcDst: ?*anyopaque,
x: i32,
y: i32,
cx: i32,
cy: i32,
xBitmap: i32,
yBitmap: i32,
rgbBk: u32,
rgbFg: u32,
fStyle: u32,
dwRop: u32,
fState: u32,
Frame: u32,
crEffect: u32,
};type
IMAGELISTDRAWPARAMS {.bycopy.} = object
cbSize: uint32
himl: int
i: int32
hdcDst: pointer
x: int32
y: int32
cx: int32
cy: int32
xBitmap: int32
yBitmap: int32
rgbBk: uint32
rgbFg: uint32
fStyle: uint32
dwRop: uint32
fState: uint32
Frame: uint32
crEffect: uint32struct IMAGELISTDRAWPARAMS
{
uint cbSize;
ptrdiff_t himl;
int i;
void* hdcDst;
int x;
int y;
int cx;
int cy;
int xBitmap;
int yBitmap;
uint rgbBk;
uint rgbFg;
uint fStyle;
uint dwRop;
uint fState;
uint Frame;
uint crEffect;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; IMAGELISTDRAWPARAMS サイズ: 68 バイト(x86)
dim st, 17 ; 4byte整数×17(構造体サイズ 68 / 4 切り上げ)
; cbSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; himl : HIMAGELIST (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; i : INT (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; hdcDst : HDC (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; x : INT (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; y : INT (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; cx : INT (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; cy : INT (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; xBitmap : INT (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; yBitmap : INT (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; rgbBk : COLORREF (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; rgbFg : COLORREF (+44, 4byte) st.11 = 値 / 値 = st.11 (lpoke/lpeek も可)
; fStyle : DWORD (+48, 4byte) st.12 = 値 / 値 = st.12 (lpoke/lpeek も可)
; dwRop : DWORD (+52, 4byte) st.13 = 値 / 値 = st.13 (lpoke/lpeek も可)
; fState : DWORD (+56, 4byte) st.14 = 値 / 値 = st.14 (lpoke/lpeek も可)
; Frame : DWORD (+60, 4byte) st.15 = 値 / 値 = st.15 (lpoke/lpeek も可)
; crEffect : COLORREF (+64, 4byte) st.16 = 値 / 値 = st.16 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; IMAGELISTDRAWPARAMS サイズ: 88 バイト(x64)
dim st, 22 ; 4byte整数×22(構造体サイズ 88 / 4 切り上げ)
; cbSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; himl : HIMAGELIST (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; i : INT (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; hdcDst : HDC (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; x : INT (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; y : INT (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; cx : INT (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; cy : INT (+44, 4byte) st.11 = 値 / 値 = st.11 (lpoke/lpeek も可)
; xBitmap : INT (+48, 4byte) st.12 = 値 / 値 = st.12 (lpoke/lpeek も可)
; yBitmap : INT (+52, 4byte) st.13 = 値 / 値 = st.13 (lpoke/lpeek も可)
; rgbBk : COLORREF (+56, 4byte) st.14 = 値 / 値 = st.14 (lpoke/lpeek も可)
; rgbFg : COLORREF (+60, 4byte) st.15 = 値 / 値 = st.15 (lpoke/lpeek も可)
; fStyle : DWORD (+64, 4byte) st.16 = 値 / 値 = st.16 (lpoke/lpeek も可)
; dwRop : DWORD (+68, 4byte) st.17 = 値 / 値 = st.17 (lpoke/lpeek も可)
; fState : DWORD (+72, 4byte) st.18 = 値 / 値 = st.18 (lpoke/lpeek も可)
; Frame : DWORD (+76, 4byte) st.19 = 値 / 値 = st.19 (lpoke/lpeek も可)
; crEffect : COLORREF (+80, 4byte) st.20 = 値 / 値 = st.20 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global IMAGELISTDRAWPARAMS
#field int cbSize
#field intptr himl
#field int i
#field intptr hdcDst
#field int x
#field int y
#field int cx
#field int cy
#field int xBitmap
#field int yBitmap
#field int rgbBk
#field int rgbFg
#field int fStyle
#field int dwRop
#field int fState
#field int Frame
#field int crEffect
#endstruct
stdim st, IMAGELISTDRAWPARAMS ; NSTRUCT 変数を確保
st->cbSize = 100
mes "cbSize=" + st->cbSize