Accusoft.ThumbnailXpress5.Net
AddItemFromStream Method
See Also  Send Feedback
Accusoft.ThumbnailXpressSdk Namespace > ThumbnailItemCollection Class : AddItemFromStream Method




item
The thumbnail to add.

Glossary Item Box

Adds the provided ThumbnailItem to the end of the collection. The display is updated if appropriate. Rather than obtaining its image data from a supplied filename/path, the image data will be expected to be provided by a System.IO.Stream object.

Syntax

 
Visual Basic
C#
Managed Extensions for C++
C++/CLI
 
 

Parameters

item
The thumbnail to add.

Return Value

Returns the new count of total thumbnails.

Remarks

The Stream object may optionally be associated with the ThumbnailItem using its ThumbnailItem.FromStream method before AddItemFromStream 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 AddItemFromStream 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

See Also

©2013. Accusoft Corporation. All Rights Reserved.