using System.Drawing; Image originalImage = Image.FromFile("myImage.jpg"); Image thumbnailImage = originalImage.GetThumbnailImage(100, 100, null, IntPtr.Zero);
using System.Drawing; Bitmap originalBitmap = new Bitmap(200, 200); Graphics graphics = Graphics.FromImage(originalBitmap); graphics.FillRectangle(Brushes.Blue, new Rectangle(0, 0, 200, 200)); Image thumbnailImage = originalBitmap.GetThumbnailImage(100, 100, null, IntPtr.Zero);In this example, we create an instance of the Bitmap class and draw a blue rectangle on it using the Graphics object. Then we create a thumbnail version of it with the same dimensions as in the previous example. The package library for this .NET framework class is "System.Drawing.dll".