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.imagemap
and append areas to the map.
Construction
创建一个空图像区域。imageAreaObj
= ImageArea()
创建一个矩形图像区域。imageAreaObj
= ImageArea(target
,altText
,x1
,y1
,x2
,y2
)
creates a circular image area.imageAreaObj
= ImageArea(target
,altText
,x
,y
,radius
)
创建一个多边形图像区域。imageAreaObj
= ImageArea(target
,altText
,polygonCoordinates
)
Input Arguments
target
—Image area hyperlink target
character vector
图像区域超链接目标,指定为:
URL of the page to be loaded when this image area is clicked
Name of a link target
altText
—Text to display if image is not visible
character vector
Text to display if the image is not visible, specified as a character vector.
x1
—x矩形图像区域左上角的X坐标,以像素为单位
unsigned integer
Specify relative to the top-left corner of the image.
Data Types:UINT16
y1
—y coordinate of top-left corner of rectangular image area
unsigned integer
Specify relative to the top-left corner of the image, in pixels.
Data Types:UINT16
x2
—x coordinate of bottom-right corner of rectangular image area
unsigned integer
Specify relative to the top-left corner of the image, in pixels.
Data Types:UINT16
y2
—y矩形图像区域右下角的Y坐标
unsigned integer
Specify relative to the top-left corner of the image, in pixels.
Data Types:UINT16
x
—x圆形图像区域中心的坐标
unsigned integer
Specify relative to the top-left corner of the image, in pixels.
Data Types:UINT16
y
—y coordinate of center of circular image area
unsigned integer
Specify relative to the top-left corner of the image, in pixels.
Data Types:UINT16
radius
—Radius of circular image area
unsigned integer
半径,以像素为单位。
Data Types:UINT16
polygonCoordinates
—多边形图像区域的坐标
大批
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
imageAreaObj
— Image area hyperlink
mlreportgen.dom.imagearea
object
图像区域超链接,由mlreportgen.dom.imagearea
目的。
Properties
目标
—图像区域目标
character vector
图像区域目标, specified as either:
URL of the page to be loaded when this image area is clicked
Name of a link target
AlternateText
—Text to display if image is not visible
character vector
Text to display if the image is not visible, specified as a character vector.
Shape
—Shape of image area
'rect'
|'circle'
|'poly'
(仅读取)可能的值是:
'rect'
— rectangular image area'circle'
— circular image area'poly'
- 多边形图像区域
Coords
—Coordinates for image area
大批
(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
—ID for this document element
character vector|string scalar
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
character vector|string scalar
标签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
Add Image Area to Image of aMATLABPlot
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);
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
选择一个网站
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select:。
您还可以从以下列表中选择一个网站:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- AméricaLatina(Español)
- Canada(English)
- 美国(English)
欧洲
- Belgium(English)
- 丹麦(English)
- Deutschland(德意志)
- españa(Español)
- Finland(English)
- 法国(Français)
- 爱尔兰(English)
- 意大利(Italiano)
- Luxembourg(English)
- Netherlands(English)
- 挪威(English)
- Österreich(德意志)
- Portugal(English)
- Sweden(English)
- 瑞士
- 英国(English)