'Thank you to bplus and the QB64.org forum for the motivation and help!
'This was made by Ken G. on Oct. 28, 2019.
_TITLE "Space Bar Makes New Picture, Mouse For Text And Press Enter When Finished, (S)ave To BMP File, Esc to Quit." again:
bb = 50
bb = bb + .25
a$ = ""
seconds = 45
r = 127
g = 100
b = 127
one:
seconds = seconds + .25
s = (60 - seconds) * 6 + (180 + tt)
x
= INT(SIN(s
/ (180 + tt
) * 3.141592) * ((180 - t
) + size
)) + xx
y
= INT(COS(s
/ (180 + tt
) * 3.141592) * ((180 - t
) + size
)) + 750 g = g + 1
seconds = 45
t = t + 1
t = 0
g = 100
more:
m = m + 1
m = 0
clr&
= POINT(mouseX
, mouseY
) LOCATE mouseY
/ 16, mouseX
/ 8 saving:
'Now we call up the SUB to save the image to BMP.
SaveImage 0, "temp.bmp"
PRINT " Your BMP file will be saved in the" PRINT " same directory as this program is." PRINT " It can be used with almost any" PRINT " other graphics program or website." PRINT " It is saved using:" PRINT " width: 800 height: 600 pixels." PRINT " Type a name to save your picture" PRINT " and press the Enter key. Do not" PRINT " add .bmp at the end, the program" PRINT " will do it automatically." PRINT " Also do not use the name temp" PRINT " because the program uses that name" PRINT " and it would be erased the next time" PRINT " you save a picture." PRINT " Quit and Enter key ends program." nm$ = nm$ + ".bmp"
'Checking to see if the file already exists on your computer.
PRINT " File Already Exists" PRINT " Saving will delete your old" PRINT " Would you like to still do it?" PRINT " Esc goes to start screen." llloop:
saving2:
nm$ = ""
IF bytesperpixel&
= 1 THEN bpp&
= 8 ELSE bpp&
= 24 b$
= "BM????QB64????" + MKL$(40) + MKL$(x&
) + MKL$(y&
) + MKI$(1) + MKI$(bpp&
) + MKL$(0) + "????" + STRING$(16, 0) 'partial BMP header info(???? to be filled later) FOR c&
= 0 TO 255 ' read BGR color settings from JPG image + 1 byte spacer(CHR$(0)) MID$(b$
, 11, 4) = MKL$(LEN(b$
)) ' image pixel data offset(BMP header) FOR py&
= y&
- 1 TO 0 STEP -1 ' read JPG image pixel color data r$ = ""
c&
= POINT(px&
, py&
) 'POINT 32 bit values are large LONG values d$ = d$ + r$ + padder$
MID$(b$
, 35, 4) = MKL$(LEN(d$
)) ' image size(BMP header) b$ = b$ + d$ ' total file data bytes to create file
MID$(b$
, 3, 4) = MKL$(LEN(b$
)) ' size of data file(BMP header)