Posted: 26th Jun 2021 18:14
I'm playing with creating Plugins for AGK2 Tier1, I decided to create a DLL that has an "image", inside the Windows.dll binary, the function: "GetImg" returns the memory address of the image in question, how do I load it this image from its memory address into AGK2?

+ Code Snippet

// Project: MemTest 
// Created: 2021-06-26

#import_plugin ImgMem As img

// show all errors
SetErrorMode(2)

// set window properties
SetWindowTitle( "MemTest" )
SetWindowSize( 1024, 768, 0 )
SetWindowAllowResize( 1 ) // allow the user to resize the window

// set display properties
SetVirtualResolution( 1024, 768 ) // doesn't have to match the window
SetOrientationAllowed( 1, 1, 1, 1 ) // allow both portrait and landscape on mobile devices
SetSyncRate( 30, 0 ) // 30fps instead of 60 to save battery
SetScissor( 0,0,0,0 ) // use the maximum available screen space, no black borders
UseNewDefaultFonts( 1 ) // since version 2.0.22 we can use nicer default fonts

// THIS COMMAND GET MEMORY ADDRESS FROM IMAGE
Message(str(img.GetImg()))


do
    

    Print( ScreenFPS() )
    Sync()
loop




screenshot :
Posted: 26th Jun 2021 20:55
Create a memblock inside the dll, copy the content from the image into it, then you can pass the memblock to agk.
Is the image a bitmap? Then you can properly format it for agk in the dll so you can even use getimagefrommemblock()
in order to simplify things on T1 side.