主要内容

mlreportgen.dom.imageareaclass

Package:mlreportgen.dom
Superclasses:

Define image area as hyperlink

Description

Define an area in an image to hyperlink to. When you click an image area, an HTML browser displays the target page, based on the URL or link target you specify. If the target is in the same document, clicking the link moves you to that location in the document. You can provide alternative text for screen readers that support alternative text. Create image areas in reports with PDF or HTML output. Create the image map usingmlreportgen.dom.imagemapand append areas to the map.

Construction

imageAreaObj= ImageArea()创建一个空图像区域。

imageAreaObj= ImageArea(target,altText,x1,y1,x2,y2)创建一个矩形图像区域。

imageAreaObj= ImageArea(target,altText,x,y,radius)creates a circular image area.

imageAreaObj= ImageArea(target,altText,polygonCoordinates)创建一个多边形图像区域。

Input Arguments

expand all

图像区域超链接目标,指定为:

  • URL of the page to be loaded when this image area is clicked

  • Name of a link target

Text to display if the image is not visible, specified as a character vector.

Specify relative to the top-left corner of the image.

Data Types:UINT16

Specify relative to the top-left corner of the image, in pixels.

Data Types:UINT16

Specify relative to the top-left corner of the image, in pixels.

Data Types:UINT16

Specify relative to the top-left corner of the image, in pixels.

Data Types:UINT16

Specify relative to the top-left corner of the image, in pixels.

Data Types:UINT16

Specify relative to the top-left corner of the image, in pixels.

Data Types:UINT16

半径,以像素为单位。

Data Types:UINT16

Specify an array of x and y coordinate pairs, with coordinates for each corner of the polygon, in the form[X1,Y1,X2,Y2,... XN,YN]。指定坐标以序列反射多边形的角。

Specify each coordinate relative to the top-left corner of the image, in pixels.

Output Arguments

expand all

图像区域超链接,由mlreportgen.dom.imagearea目的。

Properties

expand all

图像区域目标, specified as either:

  • URL of the page to be loaded when this image area is clicked

  • Name of a link target

Text to display if the image is not visible, specified as a character vector.

(仅读取)可能的值是:

  • 'rect'— rectangular image area

  • 'circle'— circular image area

  • 'poly'- 多边形图像区域

(Read-only) The coordinates represent different kinds of points, depending on the shape of the image area. Coordinates are relative to the top-left corner of the image.

  • For a rectangle, the coordinates represent the top-left corner and the bottom-right corner.

  • 对于一个圆,阵列表示圆和半径中心的坐标。

  • 对于多边形,坐标代表角落。

ID for this document element, specified as a character vector or string scalar. The DOM generates a session-unique ID when it creates the document element. You can specify your own ID.

标签for this document element, specified as a character vector or string scalar.

The DOM generates a session-unique tag as part of the creation of this object. The generated tag has the form CLASS:ID, where CLASS is the object class and ID is the value of theId对象的属性。指定自己的标签值可以帮助您确定文档生成期间问题的位置。

Examples

collapse all

importmlreportgen.dom.*d = Document('imageArea','pdf');% Create a plot and save it as an image filex = 0:π/ 100:2 *π;y = sin (x);情节(x, y);annotation('textbox',[0.2,0.4,0.1,0.1],。。。'string','Help on plot function');saveas(gcf,'plot_img.png');%创建DOM图像对象并将其附加到您的文档plot1 = Image('plot_img.png');附加(d,plot1);%定义区域并使用ImageArea链接目标target = ['//www.tatmou.com/help/matlab/ref/'。。。'plot.html?searchhighlight =绘图']; area1 = ImageArea( target,。。。'plot function help',160,340,383,392);% Create the image map object and append the area to itmap = ImageMap(); append(map,area1); plot1.Map = map; close(d); rptview(d.OutputPath);