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
holeWidthintThe width of the final image to be returned.
holeHeightintThe height of the final image to be returned.
Returns
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
holeWidthintThe width of the final image to be returned.
holeHeightintThe height of the final image to be returned.
userIdintThe id of the user whose avatar is returned.
Returns
GetBestFit(string, int, int)
[Obsolete("Use ResizeAndCrop()", false)]
public abstract string GetBestFit(string imagePathFilename, int holeWidth, int holeHeight)
Parameters
Returns
GetBestFit(string, int, int, List<string>)
[Obsolete("Use ResizeAndCrop()", false)]
public abstract string GetBestFit(string imagePathFilename, int holeWidth, int holeHeight, List<string> imageAltSizeList)
Parameters
Returns
GetBestFitWebP(string, int, int)
[Obsolete("Use ResizeAndCrop()", false)]
public abstract string GetBestFitWebP(string imagePathFilename, int holeWidth, int holeHeight)
Parameters
Returns
GetBestFitWebP(string, int, int, List<string>)
[Obsolete("Use ResizeAndCrop()", false)]
public abstract string GetBestFitWebP(string imagePathFilename, int holeWidth, int holeHeight, List<string> imageAltSizeList)
Parameters
Returns
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
imagePathFilenamestringThe source image. The is expected to be in CdnFiles (accessible with CP.CdnFiles methods).
holeWidthintThe width of the final image to be returned.
holeHeightintThe height of the final image to be returned.
Returns
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
imagePathFilenamestringThe source image. The is expected to be in CdnFiles (accessible with CP.CdnFiles methods).
holeWidthintThe width of the final image to be returned.
holeHeightintThe height of the final image to be returned.
imageAltSizesstringimageAltSizes 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.
isNewSizeboolIf true, a new size was added and you must save the imageAltSize string back
Returns
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
imagePathFilenamestringThe source image. The is expected to be in CdnFiles (accessible with CP.CdnFiles methods).
holeWidthintThe width of the final image to be returned.
holeHeightintThe height of the final image to be returned.
Returns
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
imagePathFilenamestringThe source image. The is expected to be in CdnFiles (accessible with CP.CdnFiles methods).
holeWidthintThe width of the final image to be returned.
holeHeightintThe height of the final image to be returned.
imageAltSizesstringA list of image sizes already created. Save this string with the original image URL.
isNewSizeboolIf true, a new size was added and you must save the imageAltSize string back
Returns
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
imagePathFilenamestringThe source image. The is expected to be in CdnFiles (accessible with CP.CdnFiles methods).
holeWidthintThe width of the final image to be returned.
holeHeightintThe height of the final image to be returned.
Returns
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
imagePathFilenamestringThe source image. The is expected to be in CdnFiles (accessible with CP.CdnFiles methods).
holeWidthintThe width of the final image to be returned.
holeHeightintThe height of the final image to be returned.
imageAltSizesstringimageAltSizes 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.
isNewSizeboolIf true, a new size was added and you must save the imageAltSize string back
Returns
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
imagePathFilenamestringThe source image. The is expected to be in CdnFiles (accessible with CP.CdnFiles methods).
holeWidthintThe width of the final image to be returned.
holeHeightintThe height of the final image to be returned.
Returns
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
imagePathFilenamestringThe source image. The is expected to be in CdnFiles (accessible with CP.CdnFiles methods).
holeWidthintThe width of the final image to be returned.
holeHeightintThe height of the final image to be returned.
imageAltSizesstringimageAltSizes 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.
isNewSizeboolIf true, a new size was added and you must save the imageAltSize string back