code
Member in Training
Posts: 74
|
Post by code on Oct 30, 2020 20:58:47 GMT
It creates testpage1.html and runs it... take a look...
nomainwin WindowWidth=800 WindowHeight=600
button #scr2, "make html/svg and run... ", [b1], UL, 550, 500
aan=0
for bu = 1 to 10 step 1 aan=aan+1
next bu
open "Draw with mousedown..." for graphics_nsb as #scr2
print #scr2, "fill white" print #scr2, "flush" print #scr2, "when leftButtonDown [d]"
print #scr2, "down ; size 1"
print #scr2, "when mouseMove [d2]"
fl=0 ln=0 dim x1(900) dim y1(900) dim x2(900) dim y2(900) xp=30 yp=120 wait
[d2] print #scr2, "fill white" print #scr2, "flush" for dbl = 0 to fl step 1 print #scr2, "color blue" print #scr2, "line ";x1(dbl);" ";y1(dbl);" ";x2(dbl);" ";y2(dbl);
next dbl if status=1 then print #scr2, "color blue" print #scr2, "line ";x1(ln);" ";y1(ln);" ";MouseX;" ";MouseY;
end if wait [d]
status=status+1
if status=2 then fl=fl+1 x2(fl)=MouseX y2(fl)=MouseY
status=0 end if
if status=1 then ln=ln+1 x1(ln)=MouseX y1(ln)=MouseY end if
wait
[b1] open "testpage1.html" for output as #tf
print #tf," <svg height='1800' width='1800' >" for dbl = 0 to fl step 1
print #tf, "<line x1=";x1(dbl);" y1=";y1(dbl);" x2=";x2(dbl);" y2=";y2(dbl);" style=stroke:rgb(0,0,255);stroke-width:1 />"
print #tf,"" next dbl print #tf,"</svg>" print #tf,"<input type=button value='Print...' onclick=window.print(); style=position:absolute;left:300;top:500;>" print #tf,""
close #tf
b$ = "testpage1.html" RUN "rundll32.exe url.dll,FileProtocolHandler ";b$
wait
|
|
|
Post by Rod on Nov 2, 2020 14:23:08 GMT
It worked, but only after I saved the .bas to a user directory of my own. So start the IDE, copy the code, save as something.bas, run that. then it saves the .html and opens the browser to display it.
|
|
|
Post by tenochtitlanuk on Nov 2, 2020 16:44:00 GMT
Readers might like to look at the very similar page on my website...
|
|
code
Member in Training
Posts: 74
|
Post by code on Nov 2, 2020 18:53:09 GMT
Hi, Thanks for the replies.... Regards, code
|
|