|
Post by tsh73 on May 4, 2022 7:37:09 GMT -5
Just to show that to use DRAWBMP you don't need to save bitmap to a file.
'Here's a problem for you. 'Not knowing the features of the compiler, I drew a drawing with the program. 'I put part of the drawing in memory according to the pointer 'and tried to draw it in another place. 'It turned out that this could not be done. 'You need to save the drawing to a file, then download it from the file and then draw.
nomainwin open "test" for graphics as #gr #gr "down" #gr "trapclose [quit]" 'draw a thing
#gr "fill cyan" #gr "place 15 15" '#gr "home" for i = 0 to 30 #gr "go ";i/6+1;"; turn 20" next
'grab it from screen #gr "getbmp mybmp 0 0 30 30"
timer 500, [t1] wait [t1]
#gr "place 0 0" #gr "boxfilled30 30"
timer 500, [t2] wait [t2] timer 0
'clear #gr "cls" 'put it to several different places
for i = 1 to 30 x = int(rnd(0)*270) y = int(rnd(0)*270) #gr "drawbmp mybmp ";x;" ";y next
wait
[quit] close #gr end
|
|
timur77
Junior Member

Someday I will tell my grandsons that I am older than the Internet. And it will blow their brain.
Posts: 79
|
Post by timur77 on May 4, 2022 7:45:13 GMT -5
I made a mistake somewhere at home, it's good that it works this way, I can finish one project more efficiently. (so I need to look for another error) (#gr "boxfilled 30 30" - with a space). Thank you for dispelling my misconception.
|
|
timur77
Junior Member

Someday I will tell my grandsons that I am older than the Internet. And it will blow their brain.
Posts: 79
|
Post by timur77 on May 20, 2022 9:25:57 GMT -5
Just to show that to use DRAWBMP you don't need to save bitmap to a file. 'Here's a problem for you. 'Not knowing the features of the compiler, I drew a drawing with the program. 'I put part of the drawing in memory according to the pointer 'and tried to draw it in another place. 'It turned out that this could not be done. 'You need to save the drawing to a file, then download it from the file and then draw.
nomainwin open "test" for graphics as #gr #gr "down" #gr "trapclose [quit]" 'draw a thing
#gr "fill cyan" #gr "place 15 15" '#gr "home" for i = 0 to 30 #gr "go ";i/6+1;"; turn 20" next
'grab it from screen #gr "getbmp mybmp 0 0 30 30"
timer 500, [t1] wait [t1]
#gr "place 0 0" #gr "boxfilled30 30"
timer 500, [t2] wait [t2] timer 0
'clear #gr "cls" 'put it to several different places
for i = 1 to 30 x = int(rnd(0)*270) y = int(rnd(0)*270) #gr "drawbmp mybmp ";x;" ";y next
wait
[quit] close #gr end
I remembered what I needed! I wanted to get information about the values of the bits located at the pointer to the selected graphic area, just as if it were a pointer to a file.
|
|