ImageGear .NET v24.12 - Updated
GetDefault Method
Example 




ImageGear24.Core Assembly > ImageGear.Processing Namespace > ImGearInterpolationOptions Class : GetDefault Method
Interpolation method.
Instance of ImGearInterpolationOptions class.
Syntax
'Declaration
 
Public Shared Function GetDefault( _
   ByVal interpolationType As ImGearInterpolations _
) As ImGearInterpolationOptions
'Usage
 
Dim interpolationType As ImGearInterpolations
Dim value As ImGearInterpolationOptions
 
value = ImGearInterpolationOptions.GetDefault(interpolationType)

Parameters

interpolationType
Interpolation method.

Return Value

Remarks
Returns instance of options with most commonly used attributes for specified type of interpolation.
Example
// Creates a thumbnail 100 pixels wide maintaining aspect ratio.

// Determine appropriate height.
int newHeight = 100 * igPage.DIB.Height / igPage.DIB.Width;

// Set default interpolation to none.
ImGearInterpolations igInterpolations = ImGearInterpolations.NONE;

// If the image is 1-bit and larger than 100x100, use grayscale interpolation.
if (igPage is ImGearRasterPage &&
    1 == igPage.DIB.BitDepth &&
    igPage.DIB.Width >= 100 &&
    igPage.DIB.Height >= 100)
{
    igInterpolations = ImGearInterpolations.GRAYSCALE;
}

// Create the thumbnail using the default options for the chosen interpolation.
ImGearPage igPageThumbnail = ImGearProcessing.CreateThumbnail(igPage, 100, newHeight,
    ImGearInterpolationOptions.GetDefault(igInterpolations));
' Creates a thumbnail 100 pixels wide maintaining aspect ratio.

' Determine appropriate height.
Dim newHeight As Integer = 100 * igPage.DIB.Height / igPage.DIB.Width

' Set default interpolation to none.
Dim igInterpolations As ImGearInterpolations = ImGearInterpolations.NONE

' If the image is 1-bit and larger than 100x100, use grayscale interpolation.
If TypeOf igPage Is ImGearRasterPage AndAlso 1 = igPage.DIB.BitDepth AndAlso _
 igPage.DIB.Width >= 100 AndAlso igPage.DIB.Height >= 100 Then
    igInterpolations = ImGearInterpolations.GRAYSCALE
End If

' Create the thumbnail using the default options for the chosen interpolation.
Dim igPageThumbnail As ImGearPage
igPageThumbnail = ImGearProcessing.CreateThumbnail(igPage, 100, newHeight, _
 ImGearInterpolationOptions.GetDefault(igInterpolations))
See Also

Reference

ImGearInterpolationOptions Class
ImGearInterpolationOptions Members
ImGearInterpolationOptions Class
ImGearInterpolations Enumeration