Leadtools.Web Send comments on this topic. | Back to Introduction - All Topics | Help Version 16.5.9.25
OpenImageUrl(String,Int32) Method
See Also  Example
Leadtools.Web.Controls Namespace > WebImageViewer Class > OpenImageUrl Method : OpenImageUrl(String,Int32) Method




imageUrl
The URL or virtual directory of the image being loaded.
pageIndex
0-based index of the page to open.
imageUrl
The URL or virtual directory of the image being loaded.
pageIndex
0-based index of the page to open.
Opens the image from an URL or a virtual path and displays it.

Syntax

Visual Basic (Declaration) 
Overloads Public Sub OpenImageUrl( _
   ByVal imageUrl As String, _
   ByVal pageIndex As Integer _
) 
Visual Basic (Usage)Copy Code
Dim instance As WebImageViewer
Dim imageUrl As String
Dim pageIndex As Integer
 
instance.OpenImageUrl(imageUrl, pageIndex)
C# 
public void OpenImageUrl( 
   string imageUrl,
   int pageIndex
)
C++/CLI 
public:
void OpenImageUrl( 
   String^ imageUrl,
   int pageIndex
) 
JavaScript 
OpenImageUrl(imageUrl: string, pageIndex: integer);

Parameters

imageUrl
The URL or virtual directory of the image being loaded.
pageIndex
0-based index of the page to open.

Example

This example initializes the WebImageViewer control and load the third page of "multipage.tif", also it initializes the WebImagePanViewer control.

Visual BasicCopy Code
Public Sub WebImageViewer_OpenImageUrl(ByVal mainWebImageViewer As WebImageViewer, ByVal webImagePanViewer As WebImagePanViewer)
   mainWebImageViewer.InteractiveZoomPercent = 15
   mainWebImageViewer.MouseInteractiveMode.LeftButton = ImageViewerMouseInteractiveMode.ZoomIn
   mainWebImageViewer.MouseInteractiveMode.RightButton = ImageViewerMouseInteractiveMode.ZoomOut
   mainWebImageViewer.ScaleFactor = 1.5
   mainWebImageViewer.TileSize = New Size(450, 450)
   mainWebImageViewer.OpenImageUrl("Resources\multipage.tif", 2)
   webImagePanViewer.HorizontalAlignMode = ImageViewerAlignMode.Center
   webImagePanViewer.VerticalAlignMode = ImageViewerAlignMode.Center
   webImagePanViewer.RectangleColor = Color.Blue
   webImagePanViewer.ViewerID = mainWebImageViewer.ClientID
End Sub
C#Copy Code
public void WebImageViewer_OpenImageUrl(WebImageViewer mainWebImageViewer, WebImagePanViewer webImagePanViewer) 

   mainWebImageViewer.InteractiveZoomPercent = 15; 
   mainWebImageViewer.MouseInteractiveMode.LeftButton = ImageViewerMouseInteractiveMode.ZoomIn; 
   mainWebImageViewer.MouseInteractiveMode.RightButton = ImageViewerMouseInteractiveMode.ZoomOut; 
   mainWebImageViewer.ScaleFactor = 1.5; 
   mainWebImageViewer.TileSize = new Size(450, 450); 
   mainWebImageViewer.OpenImageUrl(@"Resources\multipage.tif", 2); 
   webImagePanViewer.HorizontalAlignMode = ImageViewerAlignMode.Center; 
   webImagePanViewer.VerticalAlignMode = ImageViewerAlignMode.Center; 
   webImagePanViewer.RectangleColor = Color.Blue; 
   webImagePanViewer.ViewerID = mainWebImageViewer.ClientID; 
}
JavaScriptCopy Code
function WebImageViewer_OpenImageUrl(mainWebImageViewer) 

   mainWebImageViewer.setInteractiveZoomPercent(15); 
   mainWebImageViewer.getMouseInteractiveMode().setLeftButton(ImageViewerMouseInteractiveMode.ZoomIn); 
   mainWebImageViewer.getMouseInteractiveMode().setRightButton(ImageViewerMouseInteractiveMode.ZoomOut); 
   mainWebImageViewer.setScaleFactor(1.5); 
   mainWebImageViewer.setUseDpi(false); 
   mainWebImageViewer.setTileSize(new ltwfSize(450, 450)); 
   mainWebImageViewer.OpenImageUrl("Resources\\multipage.tif", 2); 
}

Remarks

If the imageUrl refers to an URL, the control will download the first page (index 0) to the CacheFolder and display it. Accessing the ImageInfo property returns the name of the cached image for this URL.

Requirements

Target Platforms: Microsoft .NET Framework 2.0, Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also