要为报告创建图像,请创建一个mlreportgen.dom.image.
目的。您可以将其附加到其中一个文档元素对象:
文档
团体
段落
项目清单
桌根
例如,您可以创建一个matlab®图,将其另存为图像,并将图像添加到报告中。
进口mlreportgen.dom。*d =文档('imagearea'那'html');p =段落('plot 1');p.bold = true;附录(d,p);X = 0:PI / 100:2 * PI;y = sin(x);绘图(x,y);野生动物(GCF,'myplot_img.png');plot1 =图像('myplot_img.png');附录(d,plot1);关闭);RPTVIEW(D.OUTPUTPATH);
有关支持的图像格式列表,请参金宝app阅mlreportgen.dom.image.
。
要调整图像对象的大小,可以:
设定Image.Height.
和Image.Width.
特性。
用A.mlreportgen.dom.height.
或者mlreportgen.dom.width.
对象在A.Image.Style.
财产定义。
为了微软®单词和PDF报告,您可以使用mlreportgen.dom.scaletofit.
对象以缩放图像,使其适合在页面边距或包含它的表条目中。
保留原始文件,直到它已被复制到文档中。关闭文档时,DOM API将源图像文件的内容复制到输出文档中。
您可以将图像中的区域指定为链接。单击HTML浏览器中的图像中的链接区域打开链接。有关详细信息,请参阅创建图像映射。
mlreportgen.dom.height.
|mlreportgen.dom.image.
|mlreportgen.dom.scaletofit.
|mlreportgen.dom.width.