WebView2 日本語リファレンス
WebView2構造体 › COREWEBVIEW2_COLOR

COREWEBVIEW2_COLOR

構造体
サイズx64: 4 バイト / x86: 4 バイト

フィールド

フィールドサイズx64x86
ABYTE1+0+0
RBYTE1+1+1
GBYTE1+2+2
BBYTE1+3+3

各言語での定義

#include <windows.h>

// COREWEBVIEW2_COLOR  (x64 4 / x86 4 バイト)
typedef struct COREWEBVIEW2_COLOR {
    BYTE A;
    BYTE R;
    BYTE G;
    BYTE B;
} COREWEBVIEW2_COLOR;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct COREWEBVIEW2_COLOR
{
    public byte A;
    public byte R;
    public byte G;
    public byte B;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure COREWEBVIEW2_COLOR
    Public A As Byte
    Public R As Byte
    Public G As Byte
    Public B As Byte
End Structure
import ctypes
from ctypes import wintypes

class COREWEBVIEW2_COLOR(ctypes.Structure):
    _fields_ = [
        ("A", ctypes.c_ubyte),
        ("R", ctypes.c_ubyte),
        ("G", ctypes.c_ubyte),
        ("B", ctypes.c_ubyte),
    ]
#[repr(C)]
pub struct COREWEBVIEW2_COLOR {
    pub A: u8,
    pub R: u8,
    pub G: u8,
    pub B: u8,
}
import "golang.org/x/sys/windows"

type COREWEBVIEW2_COLOR struct {
	A byte
	R byte
	G byte
	B byte
}
type
  COREWEBVIEW2_COLOR = record
    A: Byte;
    R: Byte;
    G: Byte;
    B: Byte;
  end;
const COREWEBVIEW2_COLOR = extern struct {
    A: u8,
    R: u8,
    G: u8,
    B: u8,
};
type
  COREWEBVIEW2_COLOR {.bycopy.} = object
    A: uint8
    R: uint8
    G: uint8
    B: uint8
struct COREWEBVIEW2_COLOR
{
    ubyte A;
    ubyte R;
    ubyte G;
    ubyte B;
}

HSP用 定義

HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; COREWEBVIEW2_COLOR サイズ: 4 バイト(x64)
dim st, 1    ; 4byte整数×1(構造体サイズ 4 / 4 切り上げ)
; A : BYTE (+0, 1byte)  poke st,0,値  /  値 = peek(st,0)
; R : BYTE (+1, 1byte)  poke st,1,値  /  値 = peek(st,1)
; G : BYTE (+2, 1byte)  poke st,2,値  /  値 = peek(st,2)
; B : BYTE (+3, 1byte)  poke st,3,値  /  値 = peek(st,3)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global COREWEBVIEW2_COLOR
    #field byte A
    #field byte R
    #field byte G
    #field byte B
#endstruct

stdim st, COREWEBVIEW2_COLOR        ; NSTRUCT 変数を確保
st->A = 100
mes "A=" + st->A