This is probably trivial to most of you but it is a little challenge for me.
I have WebImageViewer on the WebPage that is showing logo. I have to update the old logo to new one using svg instead of png format. The problem is that I want to use ScaleAspectFit in DisplayMode but it appears to loose the quality, the image appears to be coarse. Now if I change DisplayMode to Center the image appears to be fine but it is smaller than I want based on the size of the WebImageViewer.
The SVG Data is like this:
I must be doing something wrong. Can someone please help me with that?
If you can share a sample project, with the SVG (or other SVG that produces the problem), what you see (screenshot) and what is expected, someone will help.
Right now, I think the information provided is a little ‘thin’.
In Xojo Web 2.0 (2025R2.1) the proper way to show an SVG is not via WebImageViewer. That control still expects raster images. SVGs should be rendered as HTML content.
Actually after I have copied the svg data from the file and pasted into WebImageViewer SGV Data field in IDE I can now see the logo properly. So ChatGPT was helpful and misleading at the same time. I used the following code to obtain the svg data:
Var svgFile As New FolderItem("/Users/grzesp/workspace/myproject/Images/Logo.svg")
Var svgText As String
If svgFile.Exists Then
Var ts As TextInputStream = TextInputStream.Open(svgFile)
ts.Encoding = Encodings.UTF8
svgText = ts.ReadAll
ts.Close
Else
svgText = "<!-- SVG file not found -->"
End If
I guess I am good now. Maybe the above will be helpful to someone else as well.