public ImageKit Layer(Image source, int offsetX, int offsetY, int width, int height, HorizontalAlignment horizontalAlignment, VerticalAlignment verticalAlignment) { var ik = new ImageKit(source); if (ik.Width > width) { ik.CropHorizontal(horizontalAlignment, width); } if (ik.Height > height) { ik.CropVertical(verticalAlignment, height); } var x = 0; var y = 0; switch (horizontalAlignment) { case HorizontalAlignment.Left: x = 0; break; case HorizontalAlignment.Center: x = (width - ik.Width) / 2; break; case HorizontalAlignment.Right: x = width - ik.Width; break; } switch (verticalAlignment) { case VerticalAlignment.Top: y = 0; break; case VerticalAlignment.Middle: y = (height - ik.Height) / 2; break; case VerticalAlignment.Bottom: y = height - ik.Height; break; } Layer(ik, offsetX + x, offsetY + y); return(this); }
public ImageKit Layer(ImageKit source, int offsetX, int offsetY, int width, int height, HorizontalAlignment horizontalAlignment, VerticalAlignment verticalAlignment) { return(Layer(source.Image, offsetX, offsetY, width, height, horizontalAlignment, verticalAlignment)); }
public ImageKit LayerCentered(ImageKit source, int offsetX, int offsetY) { return(LayerCentered(source.Image, offsetX, offsetY)); }
/// <summary> /// The Image used with the kit will be disposed of upon the completion of most operations. /// </summary> /// <param name="imageKit"></param> public ImageKit(ImageKit imageKit) { this.Image = imageKit.Image; }
public ImageKit LayerCentered(ImageKit source) { return(LayerCentered(source.Image)); }
public ImageKit Layer(ImageKit source) { return(Layer(source.Image)); }
public ImageKit Layer(ImageKit source, int x, int y) { return(Layer(source.Image, x, y)); }