/// <summary> /// Try to modify the shape effects settings. /// </summary> /// <param name="effects">Reference to chart shape effects settings to apply</param> /// <returns> /// <para> /// A <see cref="BooleanResult"/> reference that contains the result of the operation, to check if the operation is correct, the <b>Success</b> /// property will be <b>true</b> and the <b>Value</b> property will contain the value; Otherwise, the the <b>Success</b> property /// will be false and the <b>Errors</b> property will contain the errors associated with the operation, if they have been filled in. /// </para> /// <para> /// The type of the return value is <see cref="BooleanResult"/>, which contains the operation result /// </para> /// </returns> public IResult SetShapeEffects(XlsxShapeEffects effects) { if (effects == null) { return BooleanResult.CreateErroResult("size can not be null"); } try { SetIlluminationEffect(effects.Illumination); SetShadowEffect(effects.Shadow); SetReflectionEffect(effects.Reflection); SetSoftEdgeEffect(effects.SoftEdge); return BooleanResult.SuccessResult; } catch (Exception e) { return BooleanResult.FromException(e); } }
/// <summary> /// Creates a new <see cref="XlsxPicture"/> instance from this image. /// </summary> /// <param name="pictureName">Picture name</param> /// <param name="size">Picture size</param> /// <param name="border">Picture border</param> /// <param name="content">Picture content</param> /// <param name="shapeEffects">picture shape effects</param> /// <returns> /// A <see cref="XlsxPicture"/> reference from this image. /// </returns> public XlsxPicture AsPicture(string pictureName, XlsxBaseSize size = null, XlsxBorder border = null, XlsxPictureContent content = null, XlsxShapeEffects shapeEffects = null) => new XlsxPicture { Name = pictureName, UnderliyingImage = this, Size = size ?? XlsxSize.Default, Border = border ?? XlsxBorder.Default, ShapeEffects = shapeEffects ?? XlsxShapeEffects.Default, Content = content ?? XlsxPictureContent.Default, Path = Path == null ? null : Path.AbsolutePath };