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