Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Is it possible to display this SVG?
#21
(06-18-2024, 05:22 PM)SpriggsySpriggs Wrote: Attached is a 7z archive of some SVGs I made on my reMarkable 2 tablet. I want to see if anyone is capable of displaying them with the SVG loading in QB64. I've tried and failed.
First, your drawings aren't bad! They all displayed in Chrome, except for the last one "Sketches - page 5.svg" which doesn't display and I can hear my CPU fan kicking in. 

But back to your original question, have you seen this post ARRAYTO_SVG by James D Jarvis? That might come in handy for what you're trying to do. 

Also, here is some SVG-related code Google Gemini spat out, that runs and might be of use to you:

Code: (Select All)
' QB64PE 4.1.0 Program
' Draws a pool ladder graphic, similar to the provided SVG.
' We will use LINE and LINE...BF for the ladder,
' and a SIN function with LINE for the wavy water.

' Set up a 32-bit graphics screen
Screen _NewImage(640, 480, 32)
_Title "Pool Ladder"

' Define the colors from the SVG
' We'll use a dark grey for the ladder and a pool blue for the water.
Dim ladderColor As _Unsigned Long
Dim waterColor As _Unsigned Long
ladderColor = _RGB(70, 70, 70)
waterColor = _RGB(123, 175, 212)

' Clear the screen to white
Cls , _RGB(255, 255, 255)

' --- 1. Draw the Ladder ---
' We'll use LINE with the BF (Box Fill) option to draw solid rectangles.

' Define ladder geometry
Dim railLeftX As Integer
Dim railRightX As Integer
Dim rungWidth As Integer
Dim rungHeight As Integer

railLeftX = 290
railRightX = 350
rungWidth = railRightX - railLeftX
rungHeight = 8

' Draw the two main vertical rails
Line (railLeftX, 100)-(railLeftX + 10, 380), ladderColor, BF
Line (railRightX, 100)-(railRightX + 10, 380), ladderColor, BF

' Draw the three horizontal rungs
Line (railLeftX, 200)-(railRightX + 10, 200 + rungHeight), ladderColor, BF
Line (railLeftX, 260)-(railRightX + 10, 260 + rungHeight), ladderColor, BF
Line (railLeftX, 320)-(railRightX + 10, 320 + rungHeight), ladderColor, BF


' --- 2. Draw the Wavy Water Lines ---
' We'll use a SIN (sine) wave to calculate the Y position
' and a FOR...NEXT loop to draw it with LINE.

Dim x As Single
Dim y As Single
Dim yBase As Integer
Dim amplitude As Integer
Dim frequency As Single

' Define wave properties
amplitude = 10 ' How high/low the wave goes
frequency = 0.05 ' How frequent the waves are
yBase = 280 ' The vertical center of the first wave

' Draw the first wavy line
' Get the starting point
y = yBase + (Sin(100 * frequency) * amplitude)
PSet (100, y), waterColor
' Draw lines to all subsequent points
For x = 101 To 540
    y = yBase + (Sin(x * frequency) * amplitude)
    Line -(x, y), waterColor
    ' Draw a second line 1 pixel below to make it thicker
    Line -(x, y + 1), waterColor
Next x

' Draw the second wavy line, slightly lower and offset
yBase = 300
' Get the starting point (offset phase with "+ 1")
y = yBase + (Sin(100 * frequency + 1) * amplitude)
PSet (100, y), waterColor
' Draw lines to all subsequent points
For x = 101 To 540
    y = yBase + (Sin(x * frequency + 1) * amplitude)
    Line -(x, y), waterColor
    ' Draw a second line 1 pixel below to make it thicker
    Line -(x, y + 1), waterColor
Next x


' --- 3. Keep the window open ---
' Wait for a key press before exiting.
Print "Press any key to exit..."
Do
    _Limit 100 ' Prevent 100% CPU usage
    'LOOP WHILE _KEYHIT = ""
Loop Until _KeyDown(27)

End
Reply
#22
It would be a cludge, but I'm in the habit of shelling an ImageMagick command to convert Graphics formats from one's I can't handle to ones that I can.
Reply
#23
Kludge or not, ImageMagick is a great utility.
Reply
#24
I think this was answered a long, long time ago.
The noticing will continue
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to display a float number in scientific? desA 19 3,082 08-05-2024, 06:55 PM
Last Post: Jack
  setting program to display always on top of other windows without having the focus? madscijr 20 4,112 05-24-2024, 07:45 PM
Last Post: madscijr
  Font display on 3.7.0 NasaCow 6 1,447 05-17-2023, 11:55 PM
Last Post: NasaCow

Forum Jump:


Users browsing this thread: