ホーム › Devices.Display › EngTextOut
EngTextOut
関数サーフェス上にグリフ列のテキストを描画する。
シグネチャ
// GDI32.dll
#include <windows.h>
BOOL EngTextOut(
SURFOBJ* pso,
STROBJ* pstro,
FONTOBJ* pfo,
CLIPOBJ* pco,
RECTL* prclExtra,
RECTL* prclOpaque,
BRUSHOBJ* pboFore,
BRUSHOBJ* pboOpaque,
POINTL* pptlOrg,
DWORD mix
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| pso | SURFOBJ* | inout |
| pstro | STROBJ* | inout |
| pfo | FONTOBJ* | inout |
| pco | CLIPOBJ* | inout |
| prclExtra | RECTL* | inout |
| prclOpaque | RECTL* | inout |
| pboFore | BRUSHOBJ* | inout |
| pboOpaque | BRUSHOBJ* | inout |
| pptlOrg | POINTL* | inout |
| mix | DWORD | in |
戻り値の型: BOOL
各言語での呼び出し定義
// GDI32.dll
#include <windows.h>
BOOL EngTextOut(
SURFOBJ* pso,
STROBJ* pstro,
FONTOBJ* pfo,
CLIPOBJ* pco,
RECTL* prclExtra,
RECTL* prclOpaque,
BRUSHOBJ* pboFore,
BRUSHOBJ* pboOpaque,
POINTL* pptlOrg,
DWORD mix
);[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("GDI32.dll", ExactSpelling = true)]
static extern bool EngTextOut(
IntPtr pso, // SURFOBJ* in/out
IntPtr pstro, // STROBJ* in/out
IntPtr pfo, // FONTOBJ* in/out
IntPtr pco, // CLIPOBJ* in/out
IntPtr prclExtra, // RECTL* in/out
IntPtr prclOpaque, // RECTL* in/out
IntPtr pboFore, // BRUSHOBJ* in/out
IntPtr pboOpaque, // BRUSHOBJ* in/out
IntPtr pptlOrg, // POINTL* in/out
uint mix // DWORD
);<DllImport("GDI32.dll", ExactSpelling:=True)>
Public Shared Function EngTextOut(
pso As IntPtr, ' SURFOBJ* in/out
pstro As IntPtr, ' STROBJ* in/out
pfo As IntPtr, ' FONTOBJ* in/out
pco As IntPtr, ' CLIPOBJ* in/out
prclExtra As IntPtr, ' RECTL* in/out
prclOpaque As IntPtr, ' RECTL* in/out
pboFore As IntPtr, ' BRUSHOBJ* in/out
pboOpaque As IntPtr, ' BRUSHOBJ* in/out
pptlOrg As IntPtr, ' POINTL* in/out
mix As UInteger ' DWORD
) As Boolean
End Function' pso : SURFOBJ* in/out
' pstro : STROBJ* in/out
' pfo : FONTOBJ* in/out
' pco : CLIPOBJ* in/out
' prclExtra : RECTL* in/out
' prclOpaque : RECTL* in/out
' pboFore : BRUSHOBJ* in/out
' pboOpaque : BRUSHOBJ* in/out
' pptlOrg : POINTL* in/out
' mix : DWORD
Declare PtrSafe Function EngTextOut Lib "gdi32" ( _
ByVal pso As LongPtr, _
ByVal pstro As LongPtr, _
ByVal pfo As LongPtr, _
ByVal pco As LongPtr, _
ByVal prclExtra As LongPtr, _
ByVal prclOpaque As LongPtr, _
ByVal pboFore As LongPtr, _
ByVal pboOpaque As LongPtr, _
ByVal pptlOrg As LongPtr, _
ByVal mix As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
EngTextOut = ctypes.windll.gdi32.EngTextOut
EngTextOut.restype = wintypes.BOOL
EngTextOut.argtypes = [
ctypes.c_void_p, # pso : SURFOBJ* in/out
ctypes.c_void_p, # pstro : STROBJ* in/out
ctypes.c_void_p, # pfo : FONTOBJ* in/out
ctypes.c_void_p, # pco : CLIPOBJ* in/out
ctypes.c_void_p, # prclExtra : RECTL* in/out
ctypes.c_void_p, # prclOpaque : RECTL* in/out
ctypes.c_void_p, # pboFore : BRUSHOBJ* in/out
ctypes.c_void_p, # pboOpaque : BRUSHOBJ* in/out
ctypes.c_void_p, # pptlOrg : POINTL* in/out
wintypes.DWORD, # mix : DWORD
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('GDI32.dll')
EngTextOut = Fiddle::Function.new(
lib['EngTextOut'],
[
Fiddle::TYPE_VOIDP, # pso : SURFOBJ* in/out
Fiddle::TYPE_VOIDP, # pstro : STROBJ* in/out
Fiddle::TYPE_VOIDP, # pfo : FONTOBJ* in/out
Fiddle::TYPE_VOIDP, # pco : CLIPOBJ* in/out
Fiddle::TYPE_VOIDP, # prclExtra : RECTL* in/out
Fiddle::TYPE_VOIDP, # prclOpaque : RECTL* in/out
Fiddle::TYPE_VOIDP, # pboFore : BRUSHOBJ* in/out
Fiddle::TYPE_VOIDP, # pboOpaque : BRUSHOBJ* in/out
Fiddle::TYPE_VOIDP, # pptlOrg : POINTL* in/out
-Fiddle::TYPE_INT, # mix : DWORD
],
Fiddle::TYPE_INT)#[link(name = "gdi32")]
extern "system" {
fn EngTextOut(
pso: *mut SURFOBJ, // SURFOBJ* in/out
pstro: *mut STROBJ, // STROBJ* in/out
pfo: *mut FONTOBJ, // FONTOBJ* in/out
pco: *mut CLIPOBJ, // CLIPOBJ* in/out
prclExtra: *mut RECTL, // RECTL* in/out
prclOpaque: *mut RECTL, // RECTL* in/out
pboFore: *mut BRUSHOBJ, // BRUSHOBJ* in/out
pboOpaque: *mut BRUSHOBJ, // BRUSHOBJ* in/out
pptlOrg: *mut POINTL, // POINTL* in/out
mix: u32 // DWORD
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("GDI32.dll")]
public static extern bool EngTextOut(IntPtr pso, IntPtr pstro, IntPtr pfo, IntPtr pco, IntPtr prclExtra, IntPtr prclOpaque, IntPtr pboFore, IntPtr pboOpaque, IntPtr pptlOrg, uint mix);
"@
$api = Add-Type -MemberDefinition $sig -Name 'GDI32_EngTextOut' -Namespace Win32 -PassThru
# $api::EngTextOut(pso, pstro, pfo, pco, prclExtra, prclOpaque, pboFore, pboOpaque, pptlOrg, mix)#uselib "GDI32.dll"
#func global EngTextOut "EngTextOut" sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr
; EngTextOut varptr(pso), varptr(pstro), varptr(pfo), varptr(pco), varptr(prclExtra), varptr(prclOpaque), varptr(pboFore), varptr(pboOpaque), varptr(pptlOrg), mix ; 戻り値は stat
; pso : SURFOBJ* in/out -> "sptr"
; pstro : STROBJ* in/out -> "sptr"
; pfo : FONTOBJ* in/out -> "sptr"
; pco : CLIPOBJ* in/out -> "sptr"
; prclExtra : RECTL* in/out -> "sptr"
; prclOpaque : RECTL* in/out -> "sptr"
; pboFore : BRUSHOBJ* in/out -> "sptr"
; pboOpaque : BRUSHOBJ* in/out -> "sptr"
; pptlOrg : POINTL* in/out -> "sptr"
; mix : DWORD -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "GDI32.dll" #cfunc global EngTextOut "EngTextOut" var, var, var, var, var, var, var, var, var, int ; res = EngTextOut(pso, pstro, pfo, pco, prclExtra, prclOpaque, pboFore, pboOpaque, pptlOrg, mix) ; pso : SURFOBJ* in/out -> "var" ; pstro : STROBJ* in/out -> "var" ; pfo : FONTOBJ* in/out -> "var" ; pco : CLIPOBJ* in/out -> "var" ; prclExtra : RECTL* in/out -> "var" ; prclOpaque : RECTL* in/out -> "var" ; pboFore : BRUSHOBJ* in/out -> "var" ; pboOpaque : BRUSHOBJ* in/out -> "var" ; pptlOrg : POINTL* in/out -> "var" ; mix : DWORD -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "GDI32.dll" #cfunc global EngTextOut "EngTextOut" sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr, int ; res = EngTextOut(varptr(pso), varptr(pstro), varptr(pfo), varptr(pco), varptr(prclExtra), varptr(prclOpaque), varptr(pboFore), varptr(pboOpaque), varptr(pptlOrg), mix) ; pso : SURFOBJ* in/out -> "sptr" ; pstro : STROBJ* in/out -> "sptr" ; pfo : FONTOBJ* in/out -> "sptr" ; pco : CLIPOBJ* in/out -> "sptr" ; prclExtra : RECTL* in/out -> "sptr" ; prclOpaque : RECTL* in/out -> "sptr" ; pboFore : BRUSHOBJ* in/out -> "sptr" ; pboOpaque : BRUSHOBJ* in/out -> "sptr" ; pptlOrg : POINTL* in/out -> "sptr" ; mix : DWORD -> "int" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; BOOL EngTextOut(SURFOBJ* pso, STROBJ* pstro, FONTOBJ* pfo, CLIPOBJ* pco, RECTL* prclExtra, RECTL* prclOpaque, BRUSHOBJ* pboFore, BRUSHOBJ* pboOpaque, POINTL* pptlOrg, DWORD mix) #uselib "GDI32.dll" #cfunc global EngTextOut "EngTextOut" var, var, var, var, var, var, var, var, var, int ; res = EngTextOut(pso, pstro, pfo, pco, prclExtra, prclOpaque, pboFore, pboOpaque, pptlOrg, mix) ; pso : SURFOBJ* in/out -> "var" ; pstro : STROBJ* in/out -> "var" ; pfo : FONTOBJ* in/out -> "var" ; pco : CLIPOBJ* in/out -> "var" ; prclExtra : RECTL* in/out -> "var" ; prclOpaque : RECTL* in/out -> "var" ; pboFore : BRUSHOBJ* in/out -> "var" ; pboOpaque : BRUSHOBJ* in/out -> "var" ; pptlOrg : POINTL* in/out -> "var" ; mix : DWORD -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; BOOL EngTextOut(SURFOBJ* pso, STROBJ* pstro, FONTOBJ* pfo, CLIPOBJ* pco, RECTL* prclExtra, RECTL* prclOpaque, BRUSHOBJ* pboFore, BRUSHOBJ* pboOpaque, POINTL* pptlOrg, DWORD mix) #uselib "GDI32.dll" #cfunc global EngTextOut "EngTextOut" intptr, intptr, intptr, intptr, intptr, intptr, intptr, intptr, intptr, int ; res = EngTextOut(varptr(pso), varptr(pstro), varptr(pfo), varptr(pco), varptr(prclExtra), varptr(prclOpaque), varptr(pboFore), varptr(pboOpaque), varptr(pptlOrg), mix) ; pso : SURFOBJ* in/out -> "intptr" ; pstro : STROBJ* in/out -> "intptr" ; pfo : FONTOBJ* in/out -> "intptr" ; pco : CLIPOBJ* in/out -> "intptr" ; prclExtra : RECTL* in/out -> "intptr" ; prclOpaque : RECTL* in/out -> "intptr" ; pboFore : BRUSHOBJ* in/out -> "intptr" ; pboOpaque : BRUSHOBJ* in/out -> "intptr" ; pptlOrg : POINTL* in/out -> "intptr" ; mix : DWORD -> "int" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
gdi32 = windows.NewLazySystemDLL("GDI32.dll")
procEngTextOut = gdi32.NewProc("EngTextOut")
)
// pso (SURFOBJ* in/out), pstro (STROBJ* in/out), pfo (FONTOBJ* in/out), pco (CLIPOBJ* in/out), prclExtra (RECTL* in/out), prclOpaque (RECTL* in/out), pboFore (BRUSHOBJ* in/out), pboOpaque (BRUSHOBJ* in/out), pptlOrg (POINTL* in/out), mix (DWORD)
r1, _, err := procEngTextOut.Call(
uintptr(pso),
uintptr(pstro),
uintptr(pfo),
uintptr(pco),
uintptr(prclExtra),
uintptr(prclOpaque),
uintptr(pboFore),
uintptr(pboOpaque),
uintptr(pptlOrg),
uintptr(mix),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // BOOLfunction EngTextOut(
pso: Pointer; // SURFOBJ* in/out
pstro: Pointer; // STROBJ* in/out
pfo: Pointer; // FONTOBJ* in/out
pco: Pointer; // CLIPOBJ* in/out
prclExtra: Pointer; // RECTL* in/out
prclOpaque: Pointer; // RECTL* in/out
pboFore: Pointer; // BRUSHOBJ* in/out
pboOpaque: Pointer; // BRUSHOBJ* in/out
pptlOrg: Pointer; // POINTL* in/out
mix: DWORD // DWORD
): BOOL; stdcall;
external 'GDI32.dll' name 'EngTextOut';result := DllCall("GDI32\EngTextOut"
, "Ptr", pso ; SURFOBJ* in/out
, "Ptr", pstro ; STROBJ* in/out
, "Ptr", pfo ; FONTOBJ* in/out
, "Ptr", pco ; CLIPOBJ* in/out
, "Ptr", prclExtra ; RECTL* in/out
, "Ptr", prclOpaque ; RECTL* in/out
, "Ptr", pboFore ; BRUSHOBJ* in/out
, "Ptr", pboOpaque ; BRUSHOBJ* in/out
, "Ptr", pptlOrg ; POINTL* in/out
, "UInt", mix ; DWORD
, "Int") ; return: BOOL●EngTextOut(pso, pstro, pfo, pco, prclExtra, prclOpaque, pboFore, pboOpaque, pptlOrg, mix) = DLL("GDI32.dll", "bool EngTextOut(void*, void*, void*, void*, void*, void*, void*, void*, void*, dword)")
# 呼び出し: EngTextOut(pso, pstro, pfo, pco, prclExtra, prclOpaque, pboFore, pboOpaque, pptlOrg, mix)
# pso : SURFOBJ* in/out -> "void*"
# pstro : STROBJ* in/out -> "void*"
# pfo : FONTOBJ* in/out -> "void*"
# pco : CLIPOBJ* in/out -> "void*"
# prclExtra : RECTL* in/out -> "void*"
# prclOpaque : RECTL* in/out -> "void*"
# pboFore : BRUSHOBJ* in/out -> "void*"
# pboOpaque : BRUSHOBJ* in/out -> "void*"
# pptlOrg : POINTL* in/out -> "void*"
# mix : DWORD -> "dword"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。