I created an memblock image with this:
MemImage = CreateMemblockFromImage(LoadImage("bottlebrush.png"))
And then I tried to overwrite it with leap motion data like so:
AGKLeap.SaveLeapImageToMemblock(1,MemImage)
Yet, the original bottlebrush.png data is in the memblock. I know you most likely are not using leap motion, but maybe you will have some suggestions regarding how those memblocks normally are used?
// Project: test_leapcamera
// Created: 2018-06-23
SetErrorMode(2)
SetWindowTitle( "test_leapcamera" )
SetWindowSize( 1024, 768, 0 )
SetVirtualResolution( 1024, 768 )
SetSyncRate( 60, 0 )
UseNewDefaultFonts( 1 )
#import_plugin AGKLeap //Load the LeapMotion plugin
AGKLeap.Initialize() //Initialize Leap Motion
`Set Leap Motion policies
`--------------------------------------------------
`They are all currently being set to their default values, so
`they are only being called in this application for your information
AGKLeap.SetPolicy_AllowPauseResume(1)
AGKLeap.SetPolicy_EnableBackgroundFrames(1)
AGKLeap.SetPolicy_OptimizeForHMD(1)
AGKLeap.SetPolicy_CanRecieveImages(1)
screen = CreateObjectPlane (10.0, 10.0)
setobjectcolor(screen, 255,255,255,255)
AGKLeap.Update(0,0,0,-90,180,0)
MemImage = CreateMemblockFromImage(LoadImage("bottlebrush.png"))
AGKLeap.SaveLeapImageToMemblock(1,MemImage)
// FROM THE MANUAL:
// SaveLeapImageToMemblock
// This saves the specified Leap Motion camera image to the specified Memblock
// Tier 1: AGKLeap.SaveLeapImageToMemblock(integer state)
// Tier 2: AGKLeap_SaveLeapImageToMemblock(int LeapImageID, int MemblockID);
// Parameters:
// LeapImageID – The Leap Motion image ID number that will be saved.
// MemblockID – The Memblock ID number where the image will be saved.
// (Yeah, it seems to have gotten the data in the parentheses wrong for tier 1.)
pic = CreateImageFromMemblock (MemImage)
SetObjectImage( screen, pic, 0 )
do
AGKLeap.Update(0,0,0,-90,180,0)
Sync()
loop