A thumbnail can be added or inserted into the collection by defining a ThumbnailItem, and then using the FromStream method to specify a stream from which to acquire the image data. Then call the ThumbnailItemCollection methods InsertItemFromStream or AddItemFromStream.
|
PDF support is deprecated in ImagXpress; instead, please use PDF Xpress for PDF support via the UsePdfXpressForPDFsOnly property.
|
|
The ThumbnailItemCollection Add method cannot be used to add an item from stream. |
C# |
Copy Code
|
// Generate a thumbnail from stream.
System.IO.FileStream theFile;
ThumbnailItem theThumbnail;
theFile = new System.IO.FileStream("c:\\bird.jpg", System.IO.FileMode.Open, System.IO.FileAccess.Read);
theThumbnail = thumbnailXpress1.CreateThumbnailItem("", 1, ThumbnailType.Image);
theFile.Seek(0, System.IO.SeekOrigin.Begin);
theThumbnail.FromStream(theFile);
theThumbnail.Descriptor = "bird.jpg";
theThumbnail.UserTag = theFile.Name;
thumbnailXpress1.Items.AddItemFromStream(theThumbnail);
theFile.Close();
|
See Also