прозрачный фон в круглом изображении - PullRequest
0 голосов
/ 24 января 2020

enter image description here

привет, я использую ngx-img-cropper, чтобы сделать вырез в круговом режиме, я использую css, чтобы сделать результат круглым вопрос в том, что мне нужно, чтобы контур за пределами круга был прозрачным и не заполнял цвет, как на изображении выше, мне нужно, чтобы при сохранении изображения отображалась только выбранная круглая часть и прозрачный фон.

  data: any;
  cropperSettings: CropperSettings;

  @ViewChild("cropper",undefined) cropper:ImageCropperComponent;

  constructor() {
    this.cropperSettings               = new CropperSettings();
    this.cropperSettings.rounded       = true;
    this.cropperSettings.width         = 250;
    this.cropperSettings.height        = 250; 
    this.cropperSettings.croppedWidth  = 250;
    this.cropperSettings.croppedHeight = 250;
    this.cropperSettings.canvasWidth   = 350;
    this.cropperSettings.canvasHeight  = 350;
    this.cropperSettings.fileType      = "image/png";
    this.data = {};
  }


    .rounded {
      border-radius: 50% !important;
     -moz-border-radius: 50% !important;
     -webkit-border-radius: 50% !important;
     display: inline-block;
     object-fit:cover;
     text-align: center;
     width: 250px;
     height: 250px;
    }
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...