C# Class Imgix_Dotnet.Macros.FocalExtensions

Macros that work around focal points instead of the top left corner
Mostrar archivo Open project: estei/Imgix-Dotnet

Public Methods

Method Description
FocalCrop ( this image, double x, double y, int width, int height, int sourceWidth, int sourceHeight ) : ImgixImage

Crops the image around a focal point. Will try and center on the focal point if possible, but if the crop falls outside the area of the image it will adjust. Keeps the aspect of the crop.

FocalCrop ( this image, int x, int y, int width, int height, int sourceWidth, int sourceHeight ) : ImgixImage

Crops the image around a focal point. Will try and center on the focal point if possible, but if the crop falls outside the area of the image it will adjust. Keeps the aspect of the crop.

FocalResize ( this image, double x, double y, int width, int height, int sourceWidth, int sourceHeight ) : ImgixImage

Resizes the image around a focal point Crops the image to the aspect ratio with the focal point as close to center as possible. Will not stretch the image to the width and height since this will just be a bigger picture with the same details.

FocalResize ( this image, int x, int y, int width, int height, int sourceWidth, int sourceHeight ) : ImgixImage

Resizes the image around a focal point Crops the image to the aspect ratio with the focal point as close to center as possible. Will not stretch the image to the width and height since this will just be a bigger picture with the same details.

Method Details

FocalCrop() public static method

Crops the image around a focal point. Will try and center on the focal point if possible, but if the crop falls outside the area of the image it will adjust. Keeps the aspect of the crop.
If either x or y is outside the 0.0 to 1.0 range
public static FocalCrop ( this image, double x, double y, int width, int height, int sourceWidth, int sourceHeight ) : ImgixImage
image this The image to run the macro on
x double /// The horizontal position of the focal point. /// Interpreted as a percentage of the image width from the left. /// Values 0.0 to 1.0 ///
y double /// The y position of the focal point. /// Interpreted as a percentage of the image height from the top side. /// Values 0.0 to 1.0 ///
width int The width of the area to crop
height int The height of the area to crop
sourceWidth int The original image width
sourceHeight int The original image height
return ImgixImage

FocalCrop() public static method

Crops the image around a focal point. Will try and center on the focal point if possible, but if the crop falls outside the area of the image it will adjust. Keeps the aspect of the crop.
public static FocalCrop ( this image, int x, int y, int width, int height, int sourceWidth, int sourceHeight ) : ImgixImage
image this The image to run the macro on
x int The horizontal position of the focal point
y int The y position of the focal point
width int The width of the area to crop
height int The height of the area to crop
sourceWidth int The original image width
sourceHeight int The original image height
return ImgixImage

FocalResize() public static method

Resizes the image around a focal point Crops the image to the aspect ratio with the focal point as close to center as possible. Will not stretch the image to the width and height since this will just be a bigger picture with the same details.
public static FocalResize ( this image, double x, double y, int width, int height, int sourceWidth, int sourceHeight ) : ImgixImage
image this The image to run the macro on
x double /// The horizontal position of the focal point. /// Interpreted as a percentage of the image width from the left. /// Values 0.0 to 1.0 ///
y double /// The y position of the focal point. /// Interpreted as a percentage of the image height from the top side. /// Values 0.0 to 1.0 ///
width int The width of the resulting image
height int The height of the resulting image
sourceWidth int The original image width
sourceHeight int The original image height
return ImgixImage

FocalResize() public static method

Resizes the image around a focal point Crops the image to the aspect ratio with the focal point as close to center as possible. Will not stretch the image to the width and height since this will just be a bigger picture with the same details.
public static FocalResize ( this image, int x, int y, int width, int height, int sourceWidth, int sourceHeight ) : ImgixImage
image this The image to run the macro on
x int The horizontal position of the focal point
y int The y position of the focal point
width int The width of the resulting image
height int The height of the resulting image
sourceWidth int The original image width
sourceHeight int The original image height
return ImgixImage