Table of Contents

Class CPImageBaseClass

Namespace
Contensive.BaseClasses
Assembly
CPBase.dll

Image methods

public abstract class CPImageBaseClass
Inheritance
CPImageBaseClass
Inherited Members

Methods

GetAvatarCdnPathFilename(int, int)

Return the avatar CDN pathFilename for the current user, resized to the provided dimensions. To use the returned pathFilename as a link, prefix it with CP.Http.CdnFilePathPrefixAbsolute. To access the file directly, use CP.CdnFiles.

public abstract string GetAvatarCdnPathFilename(int holeWidth, int holeHeight)

Parameters

holeWidth int

The width of the final image to be returned.

holeHeight int

The height of the final image to be returned.

Returns

string

GetAvatarCdnPathFilename(int, int, int)

Return the avatar CDN pathFilename for the provided user, resized to the provided dimensions. To use the returned pathFilename as a link, prefix it with CP.Http.CdnFilePathPrefixAbsolute. To access the file directly, use CP.CdnFiles.

public abstract string GetAvatarCdnPathFilename(int holeWidth, int holeHeight, int userId)

Parameters

holeWidth int

The width of the final image to be returned.

holeHeight int

The height of the final image to be returned.

userId int

The id of the user whose avatar is returned.

Returns

string

GetBestFit(string, int, int)

[Obsolete("Use ResizeAndCrop()", false)]
public abstract string GetBestFit(string imagePathFilename, int holeWidth, int holeHeight)

Parameters

imagePathFilename string
holeWidth int
holeHeight int

Returns

string

GetBestFit(string, int, int, List<string>)

[Obsolete("Use ResizeAndCrop()", false)]
public abstract string GetBestFit(string imagePathFilename, int holeWidth, int holeHeight, List<string> imageAltSizeList)

Parameters

imagePathFilename string
holeWidth int
holeHeight int
imageAltSizeList List<string>

Returns

string

GetBestFitWebP(string, int, int)

[Obsolete("Use ResizeAndCrop()", false)]
public abstract string GetBestFitWebP(string imagePathFilename, int holeWidth, int holeHeight)

Parameters

imagePathFilename string
holeWidth int
holeHeight int

Returns

string

GetBestFitWebP(string, int, int, List<string>)

[Obsolete("Use ResizeAndCrop()", false)]
public abstract string GetBestFitWebP(string imagePathFilename, int holeWidth, int holeHeight, List<string> imageAltSizeList)

Parameters

imagePathFilename string
holeWidth int
holeHeight int
imageAltSizeList List<string>

Returns

string

ResizeAndCrop(string, int, int)

Return an image in .webP format resized so its smallest dimension fits the hole, and the other diminsion cropped. To use the returned pathFilename as a link, prefix it with CP.Http.CdnFilePathPrefixAbsolute. To access the file directly, use Cp.CdnFiles. The image is never scaled up. If the hole is larger than the image, the original is returned. The source imagePathFilename is expected to be in the CdnFiles filesystem. New image is saved back to the same path.

public abstract string ResizeAndCrop(string imagePathFilename, int holeWidth, int holeHeight)

Parameters

imagePathFilename string

The source image. The is expected to be in CdnFiles (accessible with CP.CdnFiles methods).

holeWidth int

The width of the final image to be returned.

holeHeight int

The height of the final image to be returned.

Returns

string

ResizeAndCrop(string, int, int, ref string, out bool)

Return an image in .webP format resized so its smallest dimension fits the hole, and the other diminsion cropped. To use the returned pathFilename as a link, prefix it with CP.Http.CdnFilePathPrefixAbsolute. To access the file directly, use Cp.CdnFiles. The image is never scaled up. If the hole is larger than the image, the original is returned. The source imagePathFilename is expected to be in the CdnFiles filesystem. New image is saved back to the same path.
Use imageAltSizes to determine what sizes have been created.

public abstract string ResizeAndCrop(string imagePathFilename, int holeWidth, int holeHeight, ref string imageAltSizes, out bool isNewSize)

Parameters

imagePathFilename string

The source image. The is expected to be in CdnFiles (accessible with CP.CdnFiles methods).

holeWidth int

The width of the final image to be returned.

holeHeight int

The height of the final image to be returned.

imageAltSizes string

imageAltSizes is a list of comma separated strings. the first string is the original filename. The rest are the sizes already created and expected to be in the cdn folder, in the format width + "x" + height.

isNewSize bool

If true, a new size was added and you must save the imageAltSize string back

Returns

string

ResizeAndCropNoTypeChange(string, int, int)

Return an image resized so its smallest dimension fits the hole, and the other diminsion cropped. To use the returned pathFilename as a link, prefix it with CP.Http.CdnFilePathPrefixAbsolute. To access the file directly, use Cp.CdnFiles. The image is never scaled up. If the hole is larger than the image, the original is cropped returned. The source imagePathFilename is expected to be in the CdnFiles filesystem. The new image is saved back to the same path.

public abstract string ResizeAndCropNoTypeChange(string imagePathFilename, int holeWidth, int holeHeight)

Parameters

imagePathFilename string

The source image. The is expected to be in CdnFiles (accessible with CP.CdnFiles methods).

holeWidth int

The width of the final image to be returned.

holeHeight int

The height of the final image to be returned.

Returns

string

ResizeAndCropNoTypeChange(string, int, int, ref string, out bool)

Return an image resized so its smallest dimension fits the hole, and the other diminsion cropped. To use the returned pathFilename as a link, prefix it with CP.Http.CdnFilePathPrefixAbsolute. To access the file directly, use CP.CdnFiles. The image is never scaled up. If the hole is larger than the image, the original is cropped returned. The source imagePathFilename is expected to be in the CdnFiles filesystem. The new image is saved back to the same path.

public abstract string ResizeAndCropNoTypeChange(string imagePathFilename, int holeWidth, int holeHeight, ref string imageAltSizes, out bool isNewSize)

Parameters

imagePathFilename string

The source image. The is expected to be in CdnFiles (accessible with CP.CdnFiles methods).

holeWidth int

The width of the final image to be returned.

holeHeight int

The height of the final image to be returned.

imageAltSizes string

A list of image sizes already created. Save this string with the original image URL.

isNewSize bool

If true, a new size was added and you must save the imageAltSize string back

Returns

string

ResizeAndPad(string, int, int)

Return an image in .webP format resized so its largest dimension fits the hole, and the other diminsion padded transparent. To use the returned pathFilename as a link, prefix it with CP.Http.CdnFilePathPrefixAbsolute. To access the file directly, use Cp.CdnFiles. The image is never scaled up. If the hole is larger than the image, the original is returned. The source imagePathFilename is expected to be in the CdnFiles filesystem. New image is saved back to the same path.
imageAltSizeList is a list of comma separated strings. the first string is the original filename. The rest are the sizes already created and expected to be in the cdn folder, in the format width + "x" + height.

public abstract string ResizeAndPad(string imagePathFilename, int holeWidth, int holeHeight)

Parameters

imagePathFilename string

The source image. The is expected to be in CdnFiles (accessible with CP.CdnFiles methods).

holeWidth int

The width of the final image to be returned.

holeHeight int

The height of the final image to be returned.

Returns

string

ResizeAndPad(string, int, int, ref string, out bool)

Return an image in .webP format resized so its largest dimension fits the hole, and the other diminsion padded transparent. To use the returned pathFilename as a link, prefix it with CP.Http.CdnFilePathPrefixAbsolute. To access the file directly, use Cp.CdnFiles. The image is never scaled up. If the hole is larger than the image, the original is returned. The source imagePathFilename is expected to be in the CdnFiles filesystem. New image is saved back to the same path.
imageAltSizes is a list of comma separated strings. the first string is the original filename. The rest are the sizes already created and expected to be in the cdn folder, in the format width + "x" + height.

public abstract string ResizeAndPad(string imagePathFilename, int holeWidth, int holeHeight, ref string imageAltSizes, out bool isNewSize)

Parameters

imagePathFilename string

The source image. The is expected to be in CdnFiles (accessible with CP.CdnFiles methods).

holeWidth int

The width of the final image to be returned.

holeHeight int

The height of the final image to be returned.

imageAltSizes string

imageAltSizes is a list of comma separated strings. the first string is the original filename. The rest are the sizes already created and expected to be in the cdn folder, in the format width + "x" + height.

isNewSize bool

If true, a new size was added and you must save the imageAltSize string back

Returns

string

ResizeAndPadNoTypeChange(string, int, int)

Return an image resized so its largest dimension fits the hole, and the other diminsion padded transparent. To use the returned pathFilename as a link, prefix it with CP.Http.CdnFilePathPrefixAbsolute. To access the file directly, use Cp.CdnFiles. The image is never scaled up. If the hole is larger than the image, the original is returned. The source imagePathFilename is expected to be in the CdnFiles filesystem. New image is saved back to the same path.

public abstract string ResizeAndPadNoTypeChange(string imagePathFilename, int holeWidth, int holeHeight)

Parameters

imagePathFilename string

The source image. The is expected to be in CdnFiles (accessible with CP.CdnFiles methods).

holeWidth int

The width of the final image to be returned.

holeHeight int

The height of the final image to be returned.

Returns

string

ResizeAndPadNoTypeChange(string, int, int, ref string, out bool)

Return an image resized so its largest dimension fits the hole, and the other diminsion padded transparent. To use the returned pathFilename as a link, prefix it with CP.Http.CdnFilePathPrefixAbsolute. To access the file directly, use Cp.CdnFiles. The image is never scaled up. If the hole is larger than the image, the original is returned. The source imagePathFilename is expected to be in the CdnFiles filesystem. New image is saved back to the same path.
imageAltSizes is a list of comma separated strings. the first string is the original filename. The rest are the sizes already created and expected to be in the cdn folder, in the format width + "x" + height.

public abstract string ResizeAndPadNoTypeChange(string imagePathFilename, int holeWidth, int holeHeight, ref string imageAltSizes, out bool isNewSize)

Parameters

imagePathFilename string

The source image. The is expected to be in CdnFiles (accessible with CP.CdnFiles methods).

holeWidth int

The width of the final image to be returned.

holeHeight int

The height of the final image to be returned.

imageAltSizes string

imageAltSizes is a list of comma separated strings. the first string is the original filename. The rest are the sizes already created and expected to be in the cdn folder, in the format width + "x" + height.

isNewSize bool

If true, a new size was added and you must save the imageAltSize string back

Returns

string