public static void Run()
{
// ExStart:ExtractFrameFromWebPImage
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_WebPImages();
// Load an existing WebP image into the instance of WebPImage class.
using (WebPImage image = new WebPImage(dataDir + "asposelogo.webp"))
{
if (image.Blocks.Length > 2)
{
// Access a particular frame from WebP image and cast it to Raster Image
RasterImage block = (image.Blocks[2] as RasterImage);
if (block != null)
{
// Save the Raster Image to a BMP image.
block.Save(dataDir + "ExtractFrameFromWebPImage.bmp", new BmpOptions());
}
}
}
// ExEnd:ExtractFrameFromWebPImage
}
}