'to use color names
b
= INSTR(a
+ 5, x$
, " ")
reply$ = "HTTP/1.0 200 OK" + crlf$ + crlf$
reply$ = reply$ + a$
reply$ = "HTTP/1.0 200 OK" + crlf$
reply$
= reply$
+ "Content-Length:" + STR$(LEN(a$
)) + crlf$
reply$ = reply$ + "Content-Type: image/bmp" + crlf$ + crlf$
reply$ = reply$ + a$
FourOhFour:
reply$ = "HTTP/1.0 404 Not found" + crlf$
reply$ = reply$ + "Content-Length: 103" + crlf$
reply$ = reply$ + "Content-Type: text/html" + crlf$ + crlf$
reply$ = reply$ + "<html><head><title>404 Not Found</title></head><body><p>This page does not exist.</p></body></html>" + crlf$ + crlf$
c = 0
x$ = ""
request$ = ""
reply$ = ""
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)