none
What's definition of MagSetImageScalingCallback in VB.NET? RRS feed

  • Question

  • I'm searching for a right definition ofMagSetImageScalingCallback api to VB.NET but until now nothing was found on web. Someone could say how could be the signature of this function?

    Here is a "mirror" in 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 ); 
    Friday, April 27, 2018 11:28 AM

Answers

  • 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

    • Marked as answer by FL4SHC0D3R Friday, April 27, 2018 1:30 PM
    Friday, April 27, 2018 1:29 PM

All replies

  • Did you note the remarks in that documentation?  

    "Note  The MagSetImageScalingCallback function is deprecated in Windows 7 and later, and should not be used in new applications. There is no alternate functionality."

    "This function requires Windows Display Driver Model (WDDM)-capable video cards.

    This function works only when Desktop Window Manager (DWM) is off."


    Reed Kimble - "When you do things right, people won't be sure you've done anything at all"

    Friday, April 27, 2018 11:40 AM
    Moderator
  • 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

    • Marked as answer by FL4SHC0D3R Friday, April 27, 2018 1:30 PM
    Friday, April 27, 2018 1:29 PM