Replies: 1 comment
-
I think you can do it by setting resolution of bitmap. var bitmap = svgDoc.Draw();
bitmap.SetResolution(300.0f, 300.0f); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am trying to render a bitmap to be printed at 300 dpi.
Setting the PPI of the svgDocument to 300 produces a bitmap 96/96 dpi (my monitor resolution), not 300/300.
I am using the following VB code with SVG ver:3.2.3:
Public Function getResourceBitmapTest2(resource As Byte(),
size As SizeF) As Bitmap
Dim svgDoc As SvgDocument
Using stream = New MemoryStream(resource)
Dim xmlDocument As New XmlDocument()
xmlDocument.Load(stream)
svgDoc = SvgDocument.Open(xmlDocument)
End Using
svgDoc.Width = size.Width
svgDoc.Height = size.Height
svgDoc.Ppi = 300
Dim bitmap = svgDoc.Draw()
Console.WriteLine("HorizontalResolution:{0} VerticalResolution:{1}", bitmap.HorizontalResolution, bitmap.VerticalResolution)
Return bitmap
End Function
Am I not understanding how to do this?
Many thanks,
Kingman
Beta Was this translation helpful? Give feedback.
All reactions