Accusoft.ImagXpress13.Net
ToHdib(Boolean) Method




A boolean value which controls whether the current image is released from the ImageX object.
Gets a handle to an DIB (Device Independent Bitmap).
Syntax
'Declaration
 
Public Function ToHdib( _
   ByVal release As Boolean _
) As IntPtr
'Usage
 
Dim instance As ImageX
Dim release As Boolean
Dim value As IntPtr
 
value = instance.ToHdib(release)
public IntPtr ToHdib( 
   bool release
)
public: IntPtr ToHdib( 
   bool release
) 
public:
IntPtr ToHdib( 
   bool release
) 

Parameters

release
A boolean value which controls whether the current image is released from the ImageX object.

Return Value

An HDIB
Remarks

If the release parameter is true, then the ImageX object no longer has an underlying image. It will be an empty image. Otherwise, false should be set to return a copy of the underlying ImageX's HDIB.

No matter what the release parameter is, the caller will be given an HDIB that they are responsible for freeing. This HDIB value passed back from the ToHdib function is a global memory object and needs to be manually freed by the calling application otherwise memory leaks could arise.

The easiest and less resource intensive way to free the returned HDIB is to use the static DisposeHdib method.

Another way of freeing of the HDIB can be done by creating a new ImageX object using FromHdib(ImagXpress,IntPtr,Boolean)(Accusoft.ImagXpressSdk.ImagXpress imagXpress, IntPtr hdib, System.Boolean ownDib) with the ownDib parameter set to true. This will ensure the new ImageX object will take ownership of the HDIB. Then the normal ImageX's Dispose method can be called to dispose of the ImageX object and the underlying HDIB.

Note: Calling DeleteObject() will not successfully release the HDIB.

See Also

Reference

ImageX Class
ImageX Members

 

 


©2014. Accusoft Corporation. All Rights Reserved.

Send Feedback