Click or drag to resize

DocumentViewerAdd Method (Stream, ThumbnailCaptionRequestEventHandler)

Adds all pages from an image and gets the thumbnail caption and tooltip from a ThumbnailCaptionRequestEventHandler.

Namespace:  Atalasoft.Imaging.WinControls
Assembly:  Atalasoft.dotImage.WinControls (in Atalasoft.dotImage.WinControls.dll) Version: 11.0.0.0.0.297 (.NET 4.5.2, x86)
Syntax
public void Add(
	Stream stream,
	ThumbnailCaptionRequestEventHandler captionRequestHandler
)

Parameters

stream
Type: System.IOStream
The stream containing the image data.
captionRequestHandler
Type: Atalasoft.Imaging.WinControlsThumbnailCaptionRequestEventHandler
The ThumbnailCaptionRequestEventHandler called to get the thumbnail caption and tooltip.
Exceptions
ExceptionCondition
ArgumentNullException Thrown if the stream is null (Nothing in VB).
ArgumentException Thrown if the stream is not seekable or does not have read access.
Examples
private void menuAdd_Click(object sender, System.EventArgs e)
{
  // The caption and tooltip for each page will
  // be set in the OnThumbnailCaptionRequest method.
  using (FileStream fs = new FileStream(@"C:\images\multipage.tif", FileMode.Open, FileAccess.Read, FileShare.Read))
  {
      this._viewer.Add(fs, new ThumbnailCaptionRequestEventHandler(OnThumbnailCaptionRequest));
  }
}

private void OnThumbnailCaptionRequest(object sender, ThumbnailCaptionRequestEventArgs e)
{
  e.Caption = "Image " + e.Index.ToString();
  e.ToolTip = "";
}
See Also