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