public static RasterImageAllocateCallback SetRasterImageAllocateCallback(
RasterImageAllocateCallback callback
)
public:
static RasterImageAllocateCallback^ SetRasterImageAllocateCallback(
RasterImageAllocateCallback^ callback
)
def SetRasterImageAllocateCallback(self,callback):
callback
Method to be called whenever the toolkit is creating a new RasterImage object. You can pass null to stop the toolkit from calling any callback.
The previous global callback set, or null if no callback was set before (default).
This method allows you to inspect (and change the memory model being used) whenever the toolkit is creating a new RasterImage object. Generally, you can use the RasterMemoryFlags argument to the RasterImage constructor when creating new objects, however, in some instances, the toolkit will create images internally and you have no control on the memory model being passed. The callback set is global to all LEADTOOLS used in current process.
This can be useful for debugging purposes or to control the memory model of an image being creating internally in LEADTOOLS, for example, as a result of an image processing operation as described in the example.
The return value is the old callback set previously by the user, if no callback was set previously, this method will return null, this allow you to cascade callbacks together.
By default, the toolkit does not set a callback, and calling this method the first time will always return null.
When you are done when the callback, you can call this method with a null reference to stop the toolkit from calling any methods when creating RasterImage objects.
The following example will show how to use the SetRasterImageAllocateCallback method to stop LEADTOOLS from creating any disk images whatever. The RotateCommand used in the example will internally create a new RasterImage object. By default, the user has no control on the memory model for this image, however, by using this callback, the user can control (and change) the memory model used.
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document