Contents
Core Concepts
Sitefinity in Visual Studio
Sitefinity Building Parts
Developing with Sitefinity
Designing with Sitefinity
Security
How-to
API Reference
|
|
| Files Helper Classes |
Send comments on this topic. |
| See Also |
|
Developing with Sitefinity > Modules > Modules API > Generic Content Based Modules > Images and Documents > Files > Files Helper Classes |
There is a helper class available for files in the Images and Documents module: ImagesHelper.
The ImagesHelper class (Telerik.Cms.Engine assembly) generates thumbnails, saves an image to stream and checks if an item
is browsable:
| Class ImagesHelper |
Copy Code |
|
public static Image GenerateThumbnail(int
width, int height, Image image) public
static Image GenerateThumbnail(int width,
int height, Image image, bool keepProportions) public static Image
GenerateThumbnail(int width, int height, Image
image, bool keepProportions, bool decreaseOnly) public static void SaveImageToStream(Image image, MemoryStream stream, string mimeType) public static bool IsBrowserImage(IContent
content) public static bool IsBrowserImage(IThumbnail thumbnail) public static bool
IsBrowserImage(string extension)
|
-
The IsBrowserImage method checks if the passed parameter is browsable - this could be an image, a content item or an extension. The
overload methods for the image and content item parameters retrieve the extension of the parameter and pass it to the corresponding overload,
IsBrowserImage(string extension), which checks the type of extension and returns a boolean value: true if browsable.
- The SaveImageToStream method changes the extension of the passed image. There are four possible values for the mimeType parameter:
.bmp, .gif, .jpeg, .png.
See Also
|