【发布时间】:2018-05-26 02:14:49
【问题描述】:
我正在访问一个 API,在清理图像字符串后,我在 json 对象中获取 svg 图像字符串
this.apiService.receiveImageAsNonJSON("http://localhost:8080/icreate/getViewImagesBySubCategory", subCatName).subscribe(viewImageDataSet => {
this.masterImageList = viewImageDataSet;
var masterImageListLength = this.masterImageList.length;
// Calculate number columns , number of rows is fixed at 7
let colCount = Math.ceil(masterImageListLength / 7);
for (var index = 0; index < masterImageListLength; index++) {
// Sanitize image string
this.masterImageList[index] = this.sanitizer.bypassSecurityTrustHtml(this.masterImageList[index] as string);
});
现在我使用 [outerHTML] 属性在 html 中显示图像。我得到了 svg 的实际大小,但我想要我的自定义大小。如何解决它。任何人请给光。提前谢谢你--Midde
这里我附上了屏幕截图,并在蓝色圆圈中标记了我想要自定义的高度和宽度。 Output Screen Shot
【问题讨论】:
标签: javascript html angular svg