/// <summary>
 /// Initializes a new instance of the <see cref="ImageBrushApplicator"/> class.
 /// </summary>
 /// <param name="image">
 /// The image.
 /// </param>
 /// <param name="region">
 /// The region.
 /// </param>
 public ImageBrushApplicator(IImageBase <TColor> image, RectangleF region)
 {
     this.source  = image.Lock();
     this.xLength = image.Width;
     this.yLength = image.Height;
     this.offset  = new Vector2((float)Math.Max(Math.Floor(region.Top), 0), (float)Math.Max(Math.Floor(region.Left), 0));
 }
Example #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ImageBrushApplicator"/> class.
 /// </summary>
 /// <param name="image">
 /// The image.
 /// </param>
 /// <param name="region">
 /// The region.
 /// </param>
 /// <param name="sourcePixels">
 /// The sourcePixels.
 /// </param>
 public ImageBrushApplicator(PixelAccessor <TColor> sourcePixels, IImageBase <TColor> image, RectangleF region)
     : base(sourcePixels)
 {
     this.source  = image.Lock();
     this.xLength = image.Width;
     this.yLength = image.Height;
     this.offset  = new Vector2(MathF.Max(MathF.Floor(region.Top), 0), MathF.Max(MathF.Floor(region.Left), 0));
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ImageBrushApplicator"/> class.
 /// </summary>
 /// <param name="image">
 /// The image.
 /// </param>
 /// <param name="region">
 /// The region.
 /// </param>
 /// <param name="options">The options</param>
 /// <param name="sourcePixels">
 /// The sourcePixels.
 /// </param>
 public ImageBrushApplicator(PixelAccessor <TPixel> sourcePixels, IImageBase <TPixel> image, RectangleF region, GraphicsOptions options)
     : base(sourcePixels, options)
 {
     this.source  = image.Lock();
     this.xLength = image.Width;
     this.yLength = image.Height;
     this.offsetY = (int)MathF.Max(MathF.Floor(region.Top), 0);
     this.offsetX = (int)MathF.Max(MathF.Floor(region.Left), 0);
 }