Click or drag to resize

DocumentViewerOpen Method (RandomAccessImageSource, ThumbnailCaptionRequestEventHandler)

Adds images from a RandomAccessImageSource and gets the caption and tooltip from the specified ThumbnailCaptionRequestEventHandler.

Namespace:  Atalasoft.Imaging.WinControls
Assembly:  Atalasoft.dotImage.WinControls (in Atalasoft.dotImage.WinControls.dll) Version: 11.4.0.9.0.377 (.NET 4.5.2, x86)
Syntax
public void Open(
	RandomAccessImageSource imageSource,
	ThumbnailCaptionRequestEventHandler captionRequestHandler
)

Parameters

imageSource
Type: Atalasoft.ImagingRandomAccessImageSource
The image source to load images from.
captionRequestHandler
Type: Atalasoft.Imaging.WinControlsThumbnailCaptionRequestEventHandler
A ThumbnailCaptionRequestEventHandler that will be used to request the caption and tooltip for each thumbnail.
Exceptions
ExceptionCondition
ArgumentNullException Thrown if the imageSource argument is null (Nothing in VB).
ArgumentException Thrown if the image source does not know its total image count.
Examples
private void menuOpen_Click(object sender, System.EventArgs e)
{
  // The caption and tooltip for each page will
  // be set in the OnThumbnailCaptionRequest method.
  this._viewer.Open(new FileSystemImageSource(new string[] { @"C:\images\multipage.tif" }, true), new ThumbnailCaptionRequestEventHandler(OnThumbnailCaptionRequest));
}

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