ホーム › UI.Controls.RichEdit › RICHEDIT_IMAGE_PARAMETERS
RICHEDIT_IMAGE_PARAMETERS
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| xWidth | INT | 4 | +0 | +0 | 画像の幅(himetric単位)。 |
| yHeight | INT | 4 | +4 | +4 | 画像の高さ(himetric単位)。 |
| Ascent | INT | 4 | +8 | +8 | 画像のベースラインからの上端高さ。インライン配置時に使用。 |
| Type | INT | 4 | +12 | +12 | 画像の種類(TA_*、行内またはディスプレイ)。 |
| pwszAlternateText | LPWSTR | 8/4 | +16 | +16 | 画像の代替テキスト(Unicode)。 |
| pIStream | IStream* | 8/4 | +24 | +20 | 画像データを供給するIStreamへのポインター。 |
各言語での定義
#include <windows.h>
// RICHEDIT_IMAGE_PARAMETERS (x64 32 / x86 24 バイト)
typedef struct RICHEDIT_IMAGE_PARAMETERS {
INT xWidth;
INT yHeight;
INT Ascent;
INT Type;
LPWSTR pwszAlternateText;
IStream* pIStream;
} RICHEDIT_IMAGE_PARAMETERS;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct RICHEDIT_IMAGE_PARAMETERS
{
public int xWidth;
public int yHeight;
public int Ascent;
public int Type;
public IntPtr pwszAlternateText;
public IntPtr pIStream;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure RICHEDIT_IMAGE_PARAMETERS
Public xWidth As Integer
Public yHeight As Integer
Public Ascent As Integer
Public Type As Integer
Public pwszAlternateText As IntPtr
Public pIStream As IntPtr
End Structureimport ctypes
from ctypes import wintypes
class RICHEDIT_IMAGE_PARAMETERS(ctypes.Structure):
_fields_ = [
("xWidth", ctypes.c_int),
("yHeight", ctypes.c_int),
("Ascent", ctypes.c_int),
("Type", ctypes.c_int),
("pwszAlternateText", ctypes.c_void_p),
("pIStream", ctypes.c_void_p),
]#[repr(C)]
pub struct RICHEDIT_IMAGE_PARAMETERS {
pub xWidth: i32,
pub yHeight: i32,
pub Ascent: i32,
pub Type: i32,
pub pwszAlternateText: *mut core::ffi::c_void,
pub pIStream: *mut core::ffi::c_void,
}import "golang.org/x/sys/windows"
type RICHEDIT_IMAGE_PARAMETERS struct {
xWidth int32
yHeight int32
Ascent int32
Type int32
pwszAlternateText uintptr
pIStream uintptr
}type
RICHEDIT_IMAGE_PARAMETERS = record
xWidth: Integer;
yHeight: Integer;
Ascent: Integer;
Type: Integer;
pwszAlternateText: Pointer;
pIStream: Pointer;
end;const RICHEDIT_IMAGE_PARAMETERS = extern struct {
xWidth: i32,
yHeight: i32,
Ascent: i32,
Type: i32,
pwszAlternateText: ?*anyopaque,
pIStream: ?*anyopaque,
};type
RICHEDIT_IMAGE_PARAMETERS {.bycopy.} = object
xWidth: int32
yHeight: int32
Ascent: int32
Type: int32
pwszAlternateText: pointer
pIStream: pointerstruct RICHEDIT_IMAGE_PARAMETERS
{
int xWidth;
int yHeight;
int Ascent;
int Type;
void* pwszAlternateText;
void* pIStream;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; RICHEDIT_IMAGE_PARAMETERS サイズ: 24 バイト(x86)
dim st, 6 ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; xWidth : INT (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; yHeight : INT (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; Ascent : INT (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; Type : INT (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; pwszAlternateText : LPWSTR (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; pIStream : IStream* (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; RICHEDIT_IMAGE_PARAMETERS サイズ: 32 バイト(x64)
dim st, 8 ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; xWidth : INT (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; yHeight : INT (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; Ascent : INT (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; Type : INT (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; pwszAlternateText : LPWSTR (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; pIStream : IStream* (+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 どちらでも同じコードで動作します。
#defstruct global RICHEDIT_IMAGE_PARAMETERS
#field int xWidth
#field int yHeight
#field int Ascent
#field int Type
#field intptr pwszAlternateText
#field intptr pIStream
#endstruct
stdim st, RICHEDIT_IMAGE_PARAMETERS ; NSTRUCT 変数を確保
st->xWidth = 100
mes "xWidth=" + st->xWidth