ImageGear for .NET
Rasterize() Method
See Also  Example Send Feedback
ImageGear21.Core Assembly > ImageGear.Core Namespace > ImGearVectorPage Class > Rasterize Method : Rasterize() Method




Glossary Item Box

Creates raster image representation of contained vector image.

Syntax

 
Visual Basic
C#
Managed Extensions for C++
C++/CLI
 
 

Return Value

Stand-alone instance of ImGearPage class.

Remarks

Rasterizes vector data into raster page.

Example

C#Copy Code
ImGearPage igPage;
// Load a vector image into a ImGearPage object
using (FileStream localFile = new FileStream("vector.cgm", FileMode.Open))
    igPage = ImGearFileFormats.LoadPage(localFile, 0);
// Check if vector page, and rasterize if it is.
if (igPage is ImGearVectorPage)
{
    // Adjust the image size to 1024 width maintaining aspect ratio
    ImGearProcessing.Resize(igPage, 1024,
        igPage.DIB.Height * 1024 / igPage.DIB.Width, null);
    // Get a rasterized version of the vector image at this resolution
    igPage = ((ImGearVectorPage)igPage).Rasterize();
}
Visual BasicCopy Code
Dim igPage As ImGearPage
'Load a vector image into a ImGearPage object.
Dim localFile As FileStream = New FileStream("vector.cgm", FileMode.Open)
Try
    igPage = ImGearFileFormats.LoadPage(localFile, 0)
Finally
    localFile.Close()
End Try
'Check if vector page, and rasterize if it is.
If (TypeOf igPage Is ImGearVectorPage) Then
    'Adjust the image size to 1024 width maintaining aspect ratio.
    ImGearProcessing.Resize(igPage, 1024, _
        igPage.DIB.Height * 1024 / igPage.DIB.Width, Nothing)
    'Get a rasterized version of the vector image at this resolution.
    igPage = CType(igPage, ImGearVectorPage).Rasterize()
End If

See Also

©2013. Accusoft Corporation. All Rights Reserved.