Post by tenochtitlanuk on Apr 19, 2020 4:32:58 GMT -5
I had half an hour free in the general lockdown of everyone, and us oldies particularly.
I live in an 'Olde Englishe' village with a beautiful old church with stained glass windows.
Have had lovely spring weather, but now back to grey..
I'm not a religious person, but there's something uplifting about light through such windows.
Code following was a programmatic re-creation!
You can start with any black outline on a white background- save as a 24 bit bmp and alter the file title. Here'smine..
My animation here is slower than it will run on-screen.
UpperLeftX = 1
UpperLeftY = 1
WindowWidth =285
WindowHeight =295
nomainwin
global hdc
open "Stained flass window" for graphics_nsb as #wg
#wg "trapclose [quit]"
hw =hwnd( #wg)
calldll #user32, "GetDC", hw as ulong, hdc as ulong
loadbmp "scr", "projectWindow.bmp"
#wg "down ; fill 90 60 50 ; drawbmp scr 10 10"
for i =1 to 10000
scan
r =int( 40 +216 *rnd( 1))
g =int( 40 +216 *rnd( 1))
b =int( 40 +216 *rnd( 1))
fillCol$ =str$( r) +" " +str$( g); " " +str$( b)
#wg "backcolor "; fillCol$
targetcolor =0 ' this is the colour black of the outline to fill out to.
x =int( 20 +230 *rnd( 1))
y =int( 20 +230 *rnd( 1))
calldll #gdi32, "ExtFloodFill",_
hdc as ulong,_
x as long,_
y as long,_
targetcolor as long,_
_FLOODFILLBORDER as long,_ ' ' ie fill out 'til this colour is met...
result as long
'calldll #kernel32, "Sleep", 40 as long, ret as void
if i >9900 then ' gives time for all panes to be ( probably) filled...
#wg "getbmp scr 1 1 285 295"
bmpsave "scr", "s" +right$( "0000" +str$( i), 4) +".bmp"
end if
next i
wait
[quit]
calldll #user32, "ReleaseDC", hw as ulong, hdc as ulong, ret as void 'release the DC
close #wg
end