This website is being translated through machine translation by a third-party service. Basler does not warrant the accuracy, reliability or timeliness of any information translated by this system and will not accept liability for loss or damage incurred as a result. Content that has not yet been translated appears in English. Switch to English version
This method is called after the image class releases its image buffer. In case a user buffer has been attached using CPylonImage::AttachUserBuffer() you can use this to free your user buffer.
In case you created the event handler on the heap using new, you can call delete this at the end of the function.
// Sample handler to show how to delete the handler when allocating the handler on the heap.classMyHandler:publicCPylonImageUserBufferEventHandler{OnPylonImageUserBufferDetached(void*pUserBuffer,size_tbufferSizeBytes)override{// Use our custom memory allocator to free the user buffer.MyCustomFreeMemory(pUserBuffer);// Delete the handler.deletethis;}};// Use our custom memory allocator for pixel data.void*pUserBuffer=MyCustomAllocateMemory(640*480);// Attach user buffer using a heap-allocated event handler.CPylonImageimage;image.AttachUserBuffer(pUserBuffer,(640*480),PixelType_Mono8,640,480,0,ImageOrientation_TopDown,newMyHandler());
The default implementation does nothing. You can override this function to execute custom code.