ImageGear for .NET
Rasterize() Method
Example 




Creates raster image representation of contained vector image.
Syntax
'Declaration
 
Public Overloads MustOverride Function Rasterize() As ImGearRasterPage
'Usage
 
Dim instance As ImGearVectorPage
Dim value As ImGearRasterPage
 
value = instance.Rasterize()
public abstract ImGearRasterPage Rasterize()
public: abstract ImGearRasterPage* Rasterize(); 
public:
abstract ImGearRasterPage^ Rasterize(); 

Return Value

Stand-alone instance of ImGearPage class.
Remarks
Rasterizes vector data into raster page.
Example
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();
}
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

Reference

ImGearVectorPage Class
ImGearVectorPage Members
Overload List
ImGearPage Class

 

 


©2015. Accusoft Corporation. All Rights Reserved.

Send Feedback