Creates a thumbnail image of this
RasterImage.
Supported in Silverlight, Windows Phone 7
Syntax
Parameters
- thumbnailWidth
- The desired maximum width of the thumbnail image in pixels.
- thumbnailHeight
- The desired maximum height of the thumbnail image in pixels.
- bitsPerPixel
- The desired bits per pixel.
- viewPerspective
- The desired view perspective.
- sizeFlags
- Flags that control the resize operation.
Return Value
A new
RasterImage that is the thumbnail image.
Example
Visual Basic | Copy Code |
---|
Public Sub CreateThumbnailExample()
Dim codecs As RasterCodecs = New RasterCodecs()
Dim srcFileName As String = Path.Combine(LEAD_VARS.ImagesDir, "image1.cmp")
' Load the image
Dim srcImage As RasterImage = codecs.Load(srcFileName)
' Use the CreateTumbnail method to create a thumbnail of this image
Dim thumbnail As RasterImage = srcImage.CreateThumbnail(200, 200, 24, RasterViewPerspective.TopLeft, RasterSizeFlags.Bicubic)
Debug.Assert(thumbnail.PageCount = 1)
' Clean up
thumbnail.Dispose()
srcImage.Dispose()
codecs.Dispose()
End Sub
Public NotInheritable Class LEAD_VARS
Public Const ImagesDir As String = "C:\Users\Public\Documents\LEADTOOLS Images"
End Class |
C# | Copy Code |
---|
public void CreateThumbnailExample()
{
RasterCodecs codecs = new RasterCodecs();
string srcFileName = Path.Combine(LEAD_VARS.ImagesDir, "image1.cmp");
// Load the image
RasterImage srcImage = codecs.Load(srcFileName);
// Use the CreateTumbnail method to create a thumbnail of this image
RasterImage thumbnail = srcImage.CreateThumbnail(200, 200, 24, RasterViewPerspective.TopLeft, RasterSizeFlags.Bicubic);
Debug.Assert(thumbnail.PageCount == 1);
// Clean up
thumbnail.Dispose();
srcImage.Dispose();
codecs.Dispose();
}
static class LEAD_VARS
{
public const string ImagesDir = @"C:\Users\Public\Documents\LEADTOOLS Images";
} |
SilverlightCSharp | Copy Code |
---|
public void CreateThumbnailExample(RasterImage srcImage)
{
// Use the CreateTumbnail method to create a thumbnail of this image
RasterImage thumbnail = srcImage.CreateThumbnail(200, 200, 24, RasterViewPerspective.TopLeft, RasterSizeFlags.Bicubic);
Debug.Assert(thumbnail.PageCount == 1);
// Clean up
thumbnail.Dispose();
srcImage.Dispose();
} |
SilverlightVB | Copy Code |
---|
Public Sub CreateThumbnailExample(ByVal srcImage As RasterImage)
' Use the CreateTumbnail method to create a thumbnail of this image
Dim thumbnail As RasterImage = srcImage.CreateThumbnail(200, 200, 24, RasterViewPerspective.TopLeft, RasterSizeFlags.Bicubic)
Debug.Assert(thumbnail.PageCount = 1)
' Clean up
thumbnail.Dispose()
srcImage.Dispose()
End Sub |
Remarks
Requirements
Target Platforms: Silverlight, Windows XP, Windows Server 2003 family, Windows Server 2008 family, Windows Vista, Windows 7, MAC OS/X (Intel Only), Windows Phone 7
See Also