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