VB.NET中的MagSetImageScalingCallback定义?

时间:2018-04-27 04:02:57

标签: vb.net

我正在为VB.NET搜索MagSetImageScalingCallback api的正确定义,但到目前为止在网上找不到任何内容。有人可以说这个功能的签名怎么可能?

这是一个"镜像"在C ++中:

typedef BOOL (CALLBACK* MagImageScalingCallback)(HWND hwnd, void * srcdata, MAGIMAGEHEADER srcheader, void * destdata, MAGIMAGEHEADER destheader, RECT unclipped, RECT clipped, HRGN dirty ); 

BOOL WINAPI MagSetImageScalingCallback(HWND hwnd, MagImageScalingCallback callback ); 

1 个答案:

答案 0 :(得分:1)

Public Structure RECT
    Public Left As Int32
    Public Top As Int32
    Public Right As Int32
    Public Bottom As Int32
End Structure

Public Structure MAGIMAGEHEADER
    Public width As UInteger
    Public height As UInteger
    Public format As Guid 'Reference: https://stackoverflow.com/a/31890584/9672569
    Public stride As UInteger
    Public offset As UInteger
    Public cbSize As UInteger
End Structure

Private Delegate Function ImageScalingCallback(ByVal hwnd As IntPtr, ByVal srcdata As IntPtr, ByVal srcheader As MAGIMAGEHEADER, ByRef destdata As IntPtr, ByVal destheader As MAGIMAGEHEADER, ByVal unclipped As RECT, ByVal clipped As RECT, ByVal dirty As IntPtr) As Boolean

 <DllImport("Magnification.dll", CallingConvention:=CallingConvention.StdCall)>
    Private Shared Function MagSetImageScalingCallback(ByVal hwnd As IntPtr, ByVal callback As ImageScalingCallback) As Boolean
    End Function