ホーム › Graphics.Gdi › PELARRAY
PELARRAY
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| paXCount | INT | 4 | +0 | +0 | ピクセル配列の水平方向の要素数。 |
| paYCount | INT | 4 | +4 | +4 | ピクセル配列の垂直方向の要素数。 |
| paXExt | INT | 4 | +8 | +8 | 各ピクセルの水平方向の範囲(幅)。 |
| paYExt | INT | 4 | +12 | +12 | 各ピクセルの垂直方向の範囲(高さ)。 |
| paRGBs | BYTE | 1 | +16 | +16 | ピクセルのRGB値を格納する配列。 |
各言語での定義
#include <windows.h>
// PELARRAY (x64 20 / x86 20 バイト)
typedef struct PELARRAY {
INT paXCount;
INT paYCount;
INT paXExt;
INT paYExt;
BYTE paRGBs;
} PELARRAY;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct PELARRAY
{
public int paXCount;
public int paYCount;
public int paXExt;
public int paYExt;
public byte paRGBs;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure PELARRAY
Public paXCount As Integer
Public paYCount As Integer
Public paXExt As Integer
Public paYExt As Integer
Public paRGBs As Byte
End Structureimport ctypes
from ctypes import wintypes
class PELARRAY(ctypes.Structure):
_fields_ = [
("paXCount", ctypes.c_int),
("paYCount", ctypes.c_int),
("paXExt", ctypes.c_int),
("paYExt", ctypes.c_int),
("paRGBs", ctypes.c_ubyte),
]#[repr(C)]
pub struct PELARRAY {
pub paXCount: i32,
pub paYCount: i32,
pub paXExt: i32,
pub paYExt: i32,
pub paRGBs: u8,
}import "golang.org/x/sys/windows"
type PELARRAY struct {
paXCount int32
paYCount int32
paXExt int32
paYExt int32
paRGBs byte
}type
PELARRAY = record
paXCount: Integer;
paYCount: Integer;
paXExt: Integer;
paYExt: Integer;
paRGBs: Byte;
end;const PELARRAY = extern struct {
paXCount: i32,
paYCount: i32,
paXExt: i32,
paYExt: i32,
paRGBs: u8,
};type
PELARRAY {.bycopy.} = object
paXCount: int32
paYCount: int32
paXExt: int32
paYExt: int32
paRGBs: uint8struct PELARRAY
{
int paXCount;
int paYCount;
int paXExt;
int paYExt;
ubyte paRGBs;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; PELARRAY サイズ: 20 バイト(x64)
dim st, 5 ; 4byte整数×5(構造体サイズ 20 / 4 切り上げ)
; paXCount : INT (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; paYCount : INT (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; paXExt : INT (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; paYExt : INT (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; paRGBs : BYTE (+16, 1byte) poke st,16,値 / 値 = peek(st,16)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global PELARRAY
#field int paXCount
#field int paYCount
#field int paXExt
#field int paYExt
#field byte paRGBs
#endstruct
stdim st, PELARRAY ; NSTRUCT 変数を確保
st->paXCount = 100
mes "paXCount=" + st->paXCount