Ets_Nt_Subnet_Image_Capture_Core()

Abstract

Captures a graphical image of a subnet, with options for generating HTML.

Syntax

Ets_Nt_Subnet_Image_Capture_Core (subnet_handle, ul_x, ul_y, lr_x, lr_y, image_pixel_width, image_type, dest_ptr, directory, image_name, options, html_options, map_ptr, status_ptr)
Argument Type Description
subnet_hndl EtsT_Obj_Handle Subnet of interest.
ul_x double x coordinate of upper-left corner, in the units of the subnet.
ul_y double y coordinate of upper-left corner, in the units of the subnet.
lr_x double x coordinate of lower-right corner, in the units of the subnet.
lr_y double y coordinate of lower-right corner, in the units of the subnet.
image_pixel_width int Width of the captured image, in pixels (the height is scaled proportionately).
image_type EtsT_Image_Export_Type Format of the captured image (see image_type).
dest_ptr void * File path for the captured image (or a pointer to memory for the image buffer, if the ETSC_NT_SUBNET_IMAGE_CAPTURE_OPT_IMAGE_BUFFER option is set).
directory const char * Directory in which generated HTML should be placed. Used only if the ETSC_NT_SUBNET_IMAGE_CAPTURE_OPT_HTML_OUTPUT option is set.
image_name char * Name used to link generated HTML to a previously captured image. Used only if the ETSC_NT_SUBNET_IMAGE_CAPTURE_OPT_HTML_OUTPUT and ETSC_HTML_NT_IMAGEMAP_OPT_USE_EXTERNAL_IMAGE options are set.
options int Options for capturing the image (see options).
html_options int Options for generating HTML (see html_options). Used only if the ETSC_NT_SUBNET_IMAGE_CAPTURE_OPT_HTML_OUTPUT option is set.
map_ptr EtsT_Obj_Map * Object map used to track which of the objects that exist in multiple subnets have been exported to HTML (see map_ptr). Used only if the ETSC_NT_SUBNET_IMAGE_CAPTURE_OPT_HTML_OUTPUT option is set.

Return Type

char *

HTML page (if requested by the ETSC_NT_SUBNET_IMAGE_CAPTURE_OPT_HTML_OUTPUT option) or PRGC_NIL (if HTML is not requested or the operation fails).

ets_api_nt.h

Details

This function captures a graphical image of a subnet as it would appear in the workspace and saves it to a file (or to an image buffer, if ETSC_NT_SUBNET_IMAGE_CAPTURE_OPT_IMAGE_BUFFER is set). You specify the region to be captured by giving the upper-left and lower-right corners of the part of the subnet wanted in the image (with ul_x, ul_y, lr_x, and lr_y). The captured image will be scaled to a width specified by image_pixel_width. You can use Ets_Nt_Model_Visible_Bounds_Get() to obtain the width of the current subnet view. You can override the region or width of the capture with the ETSC_NT_SUBNET_IMAGE_CAPTURE_OPT_OVERRIDE_BOUNDS and ETSC_NT_SUBNET_IMAGE_CAPTURE_OPT_DO_NOT_FIT_TO_PAGE options.

If the ETSC_NT_SUBNET_IMAGE_CAPTURE_OPT_HTML_OUTPUT option is set, this function also will return an HTML version of the captured image. You can control how the HTML is generated by setting various HTML options (described later).

image_type

image_type must be one of the following constants:

  • EtsC_Image_Export_Type_GIF
  • EtsC_Image_Export_Type_TIFF
  • EtsC_Image_Export_Type_PNG

options

options must be either ETSC_NT_SUBNET_IMAGE_CAPTURE_OPT_NONE or an OR'ed combination of one or more of the following constants:

  • ETSC_NT_SUBNET_IMAGE_CAPTURE_OPT_HTML_OUTPUT—return an HTML version of the captured image
  • ETSC_NT_SUBNET_IMAGE_CAPTURE_OPT_OVERRIDE_BOUNDS—capture the entire subnet contents in the image instead of only the specified bounds (ul_x, ul_y, lr_x, lr_y)
  • ETSC_NT_SUBNET_IMAGE_CAPTURE_OPT_DO_NOT_FIT_TO_PAGE—capture the image in its actual size instead of scaling it to fit the specified image_pixel_width
  • ETSC_NT_SUBNET_IMAGE_CAPTURE_OPT_IMAGE_BUFFER—store the captured image in a buffer instead of saving it in a file (dest_ptr points to the image buffer)

html_options

The html_options argument is ignored unless HTML is being generated (the ETSC_NT_SUBNET_IMAGE_CAPTURE_OPT_HTML_OUTPUT option is set). html_options must be either ETSC_HTML_NT_IMAGEMAP_OPT_NONE or an OR'ed combination of one or more of the following constants:

  • ETSC_HTML_NT_IMAGEMAP_OPT_EXCLUDE_ATTRIBUTES—do not create pages with attribute data for each object
  • ETSC_HTML_NT_IMAGEMAP_OPT_SKIP_SIMPLE_SUBNETS—begin generating imagemaps with the first subnet (subnet_hndl or a child) that contains more than just a single subnet
  • ETSC_HTML_NT_IMAGEMAP_OPT_GRAPHICS_PNG—create graphics in PNG format (GIF is the default)
  • ETSC_HTML_NT_IMAGEMAP_OPT_GENERATE_BUFFER—return the HTML in a text buffer instead of a file
  • ETSC_HTML_NT_IMAGEMAP_OPT_NO_RECURSE—do not include child subnets
  • ETSC_HTML_NT_IMAGEMAP_OPT_GENERATE_OBJECT_LINKS—create the HTML with hyperlinks to the pages for each object
  • ETSC_HTML_NT_IMAGEMAP_OPT_NO_RESOLUTION_ADJUST—leave the subnet resolution as is (normally, this function will temporarily change the resolution of the subnet in order to capture the entire contents)
  • ETSC_HTML_NT_IMAGEMAP_OPT_USE_EXTERNAL_IMAGE—do not capture a graphic image; instead, link the HTML imagemap to a previously captured image specified by the image_name argument
  • ETSC_HTML_NT_IMAGEMAP_OPT_ONLY_IMAGE_TEXT—generate only the text for the imagemap instead of a complete page (this allows the text to be included on another page)
  • ETSC_HTML_NT_IMAGEMAP_OPT_NEW_BROWSER—generate hyperlinks that will open in a new browser window
  • ETSC_HTML_NT_IMAGEMAP_OPT_IS_TOP—create hyperlinks using object names that start with the subnet of interest (subnet_hndl) instead of full hierarchical names

map_ptr

map_ptr specifies an object map that is used to keep track of which objects have already been exported to HTML and which haven't been. This can be useful when you are calling Ets_Nt_Subnet_Image_Capture_Core() on several subnets and there are some objects that exist in multiple subnets. If this is the case, you should create a new map_ptr (using Ets_Obj_Map_Create()) before calling Ets_Nt_Subnet_Image_Capture_Core() the first time and destroy it after the last call.

本站文档由 北京智网畅联科技有限公司 整理、翻译并提供 · Documentation compiled and provided by Beijing ZNetLink Technology Co., Ltd.

交流群 · QQ Group:OPNET/智网妙算网络仿真交流群(群号 486383494)

原文档 © 2017 Riverbed Technology · 本站为公益翻译,由 AI 辅助完成,请仔细甄别

Original documentation © 2017 Riverbed Technology. Community translation, AI-assisted. Contact: jiazequn@znetlink.com