スライドのサムネイルを JPEG として生成

Aspose.Slides for .NET を使用して任意のスライドのサムネイルを生成するには、次の手順を実行します:

  • Presentation クラスのインスタンスを作成します。
  • ID またはインデックスを使用して、目的のスライドの参照を取得します。
  • 指定したスケールで、参照したスライドのサムネイル画像を取得します。
  • サムネイル画像を任意の画像形式で保存します。

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

    //Create a full scale image
    using (IImage image = sld.GetImage(1f, 1f))
    {
        //Save the image to disk in JPEG format
        image.Save("Test Thumbnail.jpg", ImageFormat.Jpeg);
    }
}

実行例のダウンロード

サンプルコードのダウンロード