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