Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! /usr/bin/sdlbrt
- finp$="DangenTrantor16.png":xed=128:yed=96
- fout$=finp$+".svg"
- setdisplay(xed,yed,32,1):paper(8^8-1):ink(0):pen(0):cls
- loadimage(finp$,1):pasteicon(0,0,1)
- pixid=0
- open fout$ for output as #1
- print #1,"<?xml version=\"1.0\" standalone=\"no\"?>"
- print #1,"<svg width=\""+str$(xed)+"\" height=\""+str$(yed)+"\" id=\"svg2\" version=\"1.0\">"
- for y=0 to yed-1
- for x=0 to xed-1
- u=point(x,y) mod 256
- if u<128 then:
- pixid+=1
- print #1,"<path id=\""+str$(pixid)+"\""
- print #1,"style=\"fill:#000000;stroke:none;fill-opacity:1;\""
- '- d=\"M 46,6 L 42,6 L 42,1 L 7,1 L 7,42 L 42,42 L 42,21 L 46,21 L 46,6 z\"/>
- print #1,"d=\"M "+str$(x)+","+str$(y)+" l 1,0 l 0,1 l -1,0 l 0,-1 z\"/>"
- end if
- next:next
- print #1,"</svg>"
- close #1
- 'grab(1,0,0,320,240):saveimage("pic1b.bmp",1)
- 'waitkey
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement