1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

Custom height and width of SVG image in angular4

Discussão em 'Angular' iniciado por MIDDE, Setembro 24, 2024.

  1. MIDDE

    MIDDE Guest

    I am accessing an API where in json object I am getting svg image string after sanitizing the image string

    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);
    });


    Now i am displaying the image in html by using [outerHTML] property. I am getting the actual size of the svg, But I want my custom size. How to fix it out. anyone please give light. Thank you in advance --Midde

    Here I have attached the screen shot, and mark the height and width in blue circle which I want to customize. Output Screen Shot

    Continue reading...

Compartilhe esta Página