More in this section

Forums / General Discussions / libManager.CreateImage..creating thumbnails

libManager.CreateImage..creating thumbnails

2 posts, 0 answered
  1. Harry
    Harry avatar
    13 posts
    05 Aug 2008
    09 Jun 2011
    Link to this post
    Does anyone from any code on setting a thumbnail as you call the CreateImage method?  I am able to upload the new image, etc... 

    Thanks in advance for your help

  2. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    01 Feb 2016
    14 Jun 2011
    Link to this post
    Hi Harry,

    If you use the Upload method of LibrariesManager you will be able to automatically get a thumbnail generated. Bellow is the method signature:
    /// <summary>
    /// Uploads the specified content.
    /// </summary>
    /// <param name="content">The content.</param>
    /// <param name="source">The source.</param>
    /// <param name="extension">The extension.</param>
    public virtual void Upload(MediaContent content, Stream source, string extension)

    So first you call the CreateImage method. This will give you a new instance of Image type. Then you need to upload the content to it. This means that you need to call the Upload method and pass the newly created image object, the source parameter (can be FileStream) and the extension.

    Radoslav Georgiev
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
2 posts, 0 answered