Accusoft.ThumbnailXpressSdk Namespace > ThumbnailItemCollection Class : InsertItemFromStream Method |
'Declaration Public Sub InsertItemFromStream( _ ByVal collectionIndex As Integer, _ ByVal item As ThumbnailItem _ )
'Usage Dim instance As ThumbnailItemCollection Dim collectionIndex As Integer Dim item As ThumbnailItem instance.InsertItemFromStream(collectionIndex, item)
public void InsertItemFromStream( int collectionIndex, ThumbnailItem item )
public: void InsertItemFromStream( int collectionIndex, ThumbnailItem* item )
public: void InsertItemFromStream( int collectionIndex, ThumbnailItem^ item )
The Stream object may optionally be associated with the ThumbnailItem using its ThumbnailItem.FromStream method before InsertItemFromStream is called. However, a ThumbnailXpressEvents.LoadFromStreamEventHandlermust be supplied by the application and a stream object containing the image data must be supplied during processing of the event handler. Note that the event must be handled because at any time a stream-supplied thumbnail image can be scrolled out of the ThumbnailXpress image chache, and to redisplay, the component needs to re-obtain from the application the image data stream. Additionally, the ThumbnailItem passed to InsertItemFromStream must contain a valid ThumbnailItem.UserTag object that allows the application to identify the stream object that will provide the image data for the item.
This method does not wait for images to be generated before returning. The thumbnail images are generated in the background. This means a thumbnail's image data (for example, its bitmap) is likely not available immediately after this method returns. Use the ThumbnailXpress.ItemComplete event to determine when an item's image has completed being generated before attempting to programmatically access its image data