--- title: "How to: Use Interpolation Mode to Control Image Quality During Scaling" ms.date: "03/30/2017" dev_langs: - "csharp" - "vb" helpviewer_keywords: - "interpolation mode [Windows Forms], controlling image quality" - "images [Windows Forms], scaling" - "images [Windows Forms], controlling quality" ms.assetid: fde9bccf-8aa5-4b0d-ba4b-788740627b02 --- # How to: Use Interpolation Mode to Control Image Quality During Scaling The interpolation mode of a object influences the way GDI+ scales (stretches and shrinks) images. The enumeration defines several interpolation modes, some of which are shown in the following list: - - - - - To stretch an image, each pixel in the original image must be mapped to a group of pixels in the larger image. To shrink an image, groups of pixels in the original image must be mapped to single pixels in the smaller image. The effectiveness of the algorithms that perform these mappings determines the quality of a scaled image. Algorithms that produce higher-quality scaled images tend to require more processing time. In the preceding list, is the lowest-quality mode and is the highest-quality mode. To set the interpolation mode, assign one of the members of the enumeration to the property of a object. ## Example The following example draws an image and then shrinks the image with three different interpolation modes. The following illustration shows the original image and the three smaller images. ![Screenshot that shows an image with varied interpolation settings.](./media/how-to-use-interpolation-mode-to-control-image-quality-during-scaling/varied-interpolation-settings.png) [!code-csharp[System.Drawing.WorkingWithImages#81](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Drawing.WorkingWithImages/CS/Class1.cs#81)] [!code-vb[System.Drawing.WorkingWithImages#81](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Drawing.WorkingWithImages/VB/Class1.vb#81)] ## Compiling the Code The preceding example is designed for use with Windows Forms, and it requires `e`, which is a parameter of the event handler. ## See also - [Images, Bitmaps, and Metafiles](images-bitmaps-and-metafiles.md) - [Working with Images, Bitmaps, Icons, and Metafiles](working-with-images-bitmaps-icons-and-metafiles.md)