# Render Slide as Thumbnail to JPEG by User Defined Values

> 

Source: https://docs.aspose.com/slides/net/render-slide-as-thumbnail-to-jpeg-by-user-defined-values/
Updated: 2026-08-31



To generate the thumbnail of any desired slide using Aspose.Slides for .NET:

1. Create an instance of the **Presentation** class.
1. Obtain the reference of any desired slide by using its ID or index.
1. Get the X and Y scaling factors based on user defined X and Y dimensions.
1. Get the thumbnail image of the referenced slide on a specified scale.
1. Save the thumbnail image in any desired image format.

``` csharp
using Aspose.Slides;

string filePath = @"..\..\..\Sample Files\";
string srcFileName = filePath + "User Defined Thumbnail.pptx";
string destFileName = filePath + "User Defined Thumbnail.jpg";

//Instantiate the Presentation class that represents the presentation file
using (Presentation pres = new Presentation(srcFileName))
{
    //Access the first slide
    ISlide sld = pres.Slides[0];

    //User defined dimension
    int desiredX = 1200;
    int desiredY = 800;

    //Getting scaled value  of X and Y
    float scaleX = (float)(1.0 / pres.SlideSize.Size.Width) * desiredX;
    float scaleY = (float)(1.0 / pres.SlideSize.Size.Height) * desiredY;

    //Create a full scale image
    using (IImage image = sld.GetImage(scaleX, scaleY))
    {
        //Save the image to disk in JPEG format
        image.Save(destFileName, ImageFormat.Jpeg);
    }
}
``` 
## **Download Sample Code**
- [Github](https://github.com/aspose-slides/Aspose.Slides-for-.NET/releases/tag/MissingFeaturesAsposeSlidesForOpenXMLv1.1)
- [Bitbucket](https://bitbucket.org/asposemarketplace/aspose-for-openxml/downloads/User%20Defined%20Thumbnail%20%28Aspose.Slides%29.zip)





## Related articles

- [Generating a Thumbnail from a Slide with User Defined Dimensions](https://docs.aspose.com/slides/net/generating-a-thumbnail-from-a-slide-with-user-defined-dimensions/)
- [Generate Slide Thumbnail as JPEG](https://docs.aspose.com/slides/net/generate-slide-thumbnail-as-jpeg/)
- [Render Slide as Thumbnail to JPEG](https://docs.aspose.com/slides/net/render-slide-as-thumbnail-to-jpeg/)