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