public virtual void IsNoRepeatOnAxis() { BackgroundRepeat backgroundRepeat = new BackgroundRepeat(BackgroundRepeat.BackgroundRepeatValue.SPACE, BackgroundRepeat.BackgroundRepeatValue .REPEAT); NUnit.Framework.Assert.IsFalse(backgroundRepeat.IsNoRepeatOnXAxis()); NUnit.Framework.Assert.IsFalse(backgroundRepeat.IsNoRepeatOnYAxis()); backgroundRepeat = new BackgroundRepeat(BackgroundRepeat.BackgroundRepeatValue.NO_REPEAT, BackgroundRepeat.BackgroundRepeatValue .ROUND); NUnit.Framework.Assert.IsTrue(backgroundRepeat.IsNoRepeatOnXAxis()); NUnit.Framework.Assert.IsFalse(backgroundRepeat.IsNoRepeatOnYAxis()); backgroundRepeat = new BackgroundRepeat(BackgroundRepeat.BackgroundRepeatValue.NO_REPEAT); NUnit.Framework.Assert.IsTrue(backgroundRepeat.IsNoRepeatOnXAxis()); NUnit.Framework.Assert.IsTrue(backgroundRepeat.IsNoRepeatOnYAxis()); }
/// <summary> /// Creates a new /// <see cref="BackgroundImage"/> /// instance. /// </summary> /// <param name="image"> /// background-image property. /// <see cref="iText.Kernel.Pdf.Xobject.PdfXObject"/> /// instance. /// </param> /// <param name="repeat"> /// background-repeat property. /// <see cref="BackgroundRepeat"/> /// instance. /// </param> /// <param name="position"> /// background-position property. /// <see cref="BackgroundPosition"/> /// instance. /// </param> /// <param name="backgroundSize"> /// background-size property. /// <see cref="BackgroundSize"/> /// instance. /// </param> /// <param name="linearGradientBuilder"> /// background-image property. /// <see cref="iText.Kernel.Colors.Gradients.AbstractLinearGradientBuilder"/> /// instance. /// </param> /// <param name="blendMode"> /// the image's blend mode. /// <see cref="BlendMode"/> /// instance. /// </param> /// <param name="clip"> /// background-clip property. /// <see cref="BackgroundBox"/> /// instance. /// </param> /// <param name="origin"> /// background-origin property. /// <see cref="BackgroundBox"/> /// instance. /// </param> private BackgroundImage(PdfXObject image, BackgroundRepeat repeat, BackgroundPosition position, BackgroundSize backgroundSize, AbstractLinearGradientBuilder linearGradientBuilder, BlendMode blendMode, BackgroundBox clip, BackgroundBox origin) { this.image = image; if (repeat != null) { this.repeatX = !repeat.IsNoRepeatOnXAxis(); this.repeatY = !repeat.IsNoRepeatOnYAxis(); } this.repeat = repeat; this.position = position; this.backgroundSize = backgroundSize; this.linearGradientBuilder = linearGradientBuilder; if (blendMode != null) { this.blendMode = blendMode; } this.backgroundClip = clip; this.backgroundOrigin = origin; }