ホーム › Graphics.GdiPlus › GdipGetImageType
GdipGetImageType
関数イメージの種別を取得する。
シグネチャ
// gdiplus.dll
#include <windows.h>
Status GdipGetImageType(
GpImage* image,
ImageType* type
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| image | GpImage* | inout |
| type | ImageType* | inout |
戻り値の型: Status
各言語での呼び出し定義
// gdiplus.dll
#include <windows.h>
Status GdipGetImageType(
GpImage* image,
ImageType* type
);[DllImport("gdiplus.dll", ExactSpelling = true)]
static extern int GdipGetImageType(
IntPtr image, // GpImage* in/out
ref int type // ImageType* in/out
);<DllImport("gdiplus.dll", ExactSpelling:=True)>
Public Shared Function GdipGetImageType(
image As IntPtr, ' GpImage* in/out
ByRef type As Integer ' ImageType* in/out
) As Integer
End Function' image : GpImage* in/out
' type : ImageType* in/out
Declare PtrSafe Function GdipGetImageType Lib "gdiplus" ( _
ByVal image As LongPtr, _
ByRef type As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
GdipGetImageType = ctypes.windll.gdiplus.GdipGetImageType
GdipGetImageType.restype = ctypes.c_int
GdipGetImageType.argtypes = [
ctypes.c_void_p, # image : GpImage* in/out
ctypes.c_void_p, # type : ImageType* in/out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('gdiplus.dll')
GdipGetImageType = Fiddle::Function.new(
lib['GdipGetImageType'],
[
Fiddle::TYPE_VOIDP, # image : GpImage* in/out
Fiddle::TYPE_VOIDP, # type : ImageType* in/out
],
Fiddle::TYPE_INT)#[link(name = "gdiplus")]
extern "system" {
fn GdipGetImageType(
image: *mut GpImage, // GpImage* in/out
type: *mut i32 // ImageType* in/out
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("gdiplus.dll")]
public static extern int GdipGetImageType(IntPtr image, ref int type);
"@
$api = Add-Type -MemberDefinition $sig -Name 'gdiplus_GdipGetImageType' -Namespace Win32 -PassThru
# $api::GdipGetImageType(image, type)#uselib "gdiplus.dll"
#func global GdipGetImageType "GdipGetImageType" sptr, sptr
; GdipGetImageType varptr(image), type ; 戻り値は stat
; image : GpImage* in/out -> "sptr"
; type : ImageType* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "gdiplus.dll" #cfunc global GdipGetImageType "GdipGetImageType" var, int ; res = GdipGetImageType(image, type) ; image : GpImage* in/out -> "var" ; type : ImageType* in/out -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "gdiplus.dll" #cfunc global GdipGetImageType "GdipGetImageType" sptr, int ; res = GdipGetImageType(varptr(image), type) ; image : GpImage* in/out -> "sptr" ; type : ImageType* in/out -> "int" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; Status GdipGetImageType(GpImage* image, ImageType* type) #uselib "gdiplus.dll" #cfunc global GdipGetImageType "GdipGetImageType" var, int ; res = GdipGetImageType(image, type) ; image : GpImage* in/out -> "var" ; type : ImageType* in/out -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; Status GdipGetImageType(GpImage* image, ImageType* type) #uselib "gdiplus.dll" #cfunc global GdipGetImageType "GdipGetImageType" intptr, int ; res = GdipGetImageType(varptr(image), type) ; image : GpImage* in/out -> "intptr" ; type : ImageType* in/out -> "int" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
gdiplus = windows.NewLazySystemDLL("gdiplus.dll")
procGdipGetImageType = gdiplus.NewProc("GdipGetImageType")
)
// image (GpImage* in/out), type (ImageType* in/out)
r1, _, err := procGdipGetImageType.Call(
uintptr(image),
uintptr(type),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // Statusfunction GdipGetImageType(
image: Pointer; // GpImage* in/out
type: Pointer // ImageType* in/out
): Integer; stdcall;
external 'gdiplus.dll' name 'GdipGetImageType';result := DllCall("gdiplus\GdipGetImageType"
, "Ptr", image ; GpImage* in/out
, "Ptr", type ; ImageType* in/out
, "Int") ; return: Status●GdipGetImageType(image, type) = DLL("gdiplus.dll", "int GdipGetImageType(void*, void*)")
# 呼び出し: GdipGetImageType(image, type)
# image : GpImage* in/out -> "void*"
# type : ImageType* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。