|
Post by bluatigro on Apr 18, 2019 10:14:33 GMT
WindowWidth = 600 WindowHeight = 600 global cx , cy , size input "center x = " ; cx$ input "center y = " ; cy$ input "size = " ; size$ cx = val( cx$ ) cy = val( cy$ ) size = val( size$ ) open "behang" for graphics as #m #m "trapclose [quit]" #m "setfocus" for x = 0 to 600 for y = 0 to 600 scan a = cx + x / 600 * size b = cy + y / 600 * size q = a * a + b * b if q and 1 then #m "goto " ; x ; " " ; y #m "down" #m "set " ; x ; " " ; y #m "up" end if next y next x wait [quit] close #m end
WindowWidth = 600 WindowHeight = 600 global cx , cy , size input "center x = " ; cx$ input "center y = " ; cy$ input "size = " ; size$ cx = val( cx$ ) cy = val( cy$ ) size = val( size$ ) open "behang" for graphics as #m #m "trapclose [quit]" #m "setfocus" for x = 0 to 600 for y = 0 to 600 scan a = cx + x / 600 * size b = cy + y / 600 * size q = a * a + b * b #m "color " ; word$( "yellow pink cyan" , int( q ) mod 3 + 1 ) #m "goto " ; x ; " " ; y #m "down" #m "set " ; x ; " " ; y #m "up" next y next x wait [quit] close #m end
|
|
|
Post by B+ on Apr 18, 2019 13:11:21 GMT
Ah John Connett's circle pattern. I like how you handled the color in 2nd code snippet.
I am wondering why I don't have a JB version of this already. Probably because drawing pixel by pixel is too slow but this was not too bad with JB v2.0.
|
|
|
Post by tsh73 on Apr 18, 2019 14:00:23 GMT
|
|
|
Post by B+ on Apr 18, 2019 14:21:09 GMT
|
|
|
Post by B+ on Apr 18, 2019 15:31:52 GMT
Here is how I would do Connett's Circle Patterns if I were to do a JB v2.0 version of other Basic programs I have done. 'Bplus mod and translate Connett's Circle Pattern for JB v 2.0 2019-04-18 ' start with bluatigro's 2019-04-18 post and add my translation from another BASIC
nomainwin WindowWidth = DisplayWidth WindowHeight = DisplayHeight open "Connett's Circle Patterns" for graphics_nsb_nf as #m #m "trapclose [quit]" #m "down" size = 15 sq = 5 while size if size > 1000 then size = 15 for y = 0 to DisplayHeight/sq for x = 0 to DisplayWidth/sq scan a = x / 600 * size b = y / 600 * size q = a * a + b * b d = q / 2 d = d - int(d) if d < 0.35 then #m "color ";d/.35*255;" 0 0" #m "backcolor ";d/.35*255;" 0 0" else if d <.7 then #m "color 0 ";(d-.35)/.35*255;" 0" #m "backcolor 0 ";(d-.35)/.35*255;" 0" else #m "color 0 0 ";(1-d)/.3*255 #m "backcolor 0 0 ";(1-d)/.3*255 end if end if #m "place ";x*sq-1;" ";y*sq-1 #m "boxfilled ";x*sq+sq;" ";y*sq+sq next next size = size + 15 wend wait
[quit] close #m end
|
|
|
Post by tsh73 on Apr 19, 2019 9:40:06 GMT
I found on Internet that changing a^2+b^2 to c1*a^2+c2*b^2+c3*ab+c4*a+c5*b+c6 makes all possible rotated/squished/scaled ellipses. But meaning of coefficient is not straightforward.
|
|
ntech
Junior Member
Posts: 99
|
Post by ntech on May 10, 2019 16:00:46 GMT
To automatically set the generated BMP as wallpaper, run a .bat file that has the contents:
reg add "HKCU\Control Panel\Desktop" /v Wallpaper /t REG_SZ /d c:\PATH\TO\WALLPAPER.BMP
Note that all of that has to be on one (1) line.
|
|