SVG to PNG resolution


#1

This code doesn’t seem to properly set the resolution of the PNG output. I am new to apose tools. Please advise if I am doing something wrong. I would expect that adjusting the resolution up & down would impact the file size and sharpness

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles Me.Load
    Dim License As Aspose.Imaging.License = New Aspose.Imaging.License()
    License.SetLicense("Aspose.Imaging.lic")

    Dim docs As String = My.Computer.FileSystem.SpecialDirectories.MyDocuments.ToString

    Dim svg As Aspose.Imaging.FileFormats.Svg.SvgImage = Aspose.Imaging.FileFormats.Svg.SvgImage.Load(docs & "\Profile.SVG")
    Dim pngOptions As Aspose.Imaging.ImageOptions.PngOptions = New Aspose.Imaging.ImageOptions.PngOptions()
    Dim svgOptions As Aspose.Imaging.ImageOptions.SvgRasterizationOptions = New Aspose.Imaging.ImageOptions.SvgRasterizationOptions()

    Dim rs As Aspose.Imaging.ResolutionSetting = New Aspose.Imaging.ResolutionSetting()
    rs.HorizontalResolution = 2400
    rs.VerticalResolution = 2400
    svgOptions.ResolutionSettings = rs

    pngOptions.VectorRasterizationOptions = svgOptions

    svg.Save(docs & "\Profile.PNG", pngOptions)

End Sub

#2

@danTOADLLC,

Can you please share source file along with generated result so that we may further investigate to help you out.


#3

AsposeSVG2PNGTest_2019-09-30.zip (4.5 MB)
See attached zip file. copy the 2 files in Docs subfolder to your documents folder.


#4

@danTOADLLC,

I have worked with source file and sample project shared by you. A ticket with ID IMAGINGNET-3568 has been created in our issue tracking system for further investigate the issue. This thread has been associated with this ticket, so that you can be automatically notified as soon as this issue is resolved.