DocumentViewerAdd Method (Stream, 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 Exceptions Exception | Condition |
---|
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)
{
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 = "";
}
Private Sub menuAdd_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Dim fs As FileStream = New FileStream("C:\images\multipage.tif", FileMode.Open, FileAccess.Read, FileShare.Read)
Try
Me._viewer.Add(fs, New ThumbnailCaptionRequestEventHandler(OnThumbnailCaptionRequest))
Finally
fs.Dispose()
End Try
End Sub
Private Sub OnThumbnailCaptionRequest(ByVal sender As Object, ByVal e As ThumbnailCaptionRequestEventArgs)
e.Caption = "Image " & e.Index.ToString()
e.ToolTip = ""
End Sub
See Also