_TITLE "Steve's Calendar Creator"
CONST PhotoFolder
= ".\National Geographic\" 'IF _FILEEXISTS(PhotoFolder + "PhotoList.txt") = 0 THEN
PhotoList$ = "*.jpg *.png " 'add more extensions if you want to add GIF/PNG files and such
SHELL "DIR " + PhotoList$
+ "/b /s /a-d >PhotoList.txt"
PhotoCount = PhotoCount + 1
SEEK #1, 1 'back to the beginning
FileList
(i
) = FileList
(i
) + CHR$(0)
Notes(0) = "1) Steve 555-5555"
Notes(1) = "2) Lori 555-5555"
DrawCalander
H = W 'height
L = 5 'line thickness
' Kolor = _RGB32(127, 107, 0) 'color of lines
Kolor
= _RGBA32(0, 0, 0, 128) 'color of lines
PicNum
= INT(RND * PhotoCount
) + 1
x2 = x1 + W
x1 = 0
y2 = y1 + H
y1 = 0
_PUTIMAGE (0, 0)-(W
, H
), Pic
, 0, (x1
, y1
)-(x2
, y2
)
FOR i
= 0 TO L:
LINE (0 + i
, 0 + i
)-(W
- i
, H
- i
), Kolor
, B:
NEXT 'Outer frame first FOR i
= 1 TO 6:
LINE (i
* W \
7 - L \
2, 0)-(i
* W \
7 + L \
2, W
), Kolor
, BF:
NEXT 'inner lines next FOR i
= 1 TO 6:
LINE (0, i
* W \
7 - L \
2)-(W
, i
* W \
7 + L \
2), Kolor
, BF:
NEXT LINE (L
+ 1, L
+ 1)-(W
- L
- 1, W \
7 - L \
2), Blue
, BF
'Top Box for month
FirstDay = GetDay(k, 1, Year)
count = 0
IF (y
- 1) * 7 + x
>= FirstDay
THEN count = count + 1
IF count
<= DaysInMonth
(k
) THEN
T$
= Month$
(k
) + STR$(Year
)
FUNCTION GetDay
(m
, d
, y
) 'use 4 digit year 'From Zeller's congruence: https://en.wikipedia.org/wiki/Zeller%27s_congruence
mm = m: dd = d: yyyy = y
IF mm
< 3 THEN mm
= mm
+ 12: yyyy
= yyyy
- 1 zerocentury = yyyy \ 100
result
= (dd
+ INT(13 * (mm
+ 1) / 5) + century
+ INT(century
/ 4) + INT(zerocentury
/ 4) + 5 * zerocentury
) MOD 7 GetDay = 7
GetDay = result
'Function changed to return a numeric value instead of a string for this program
' SELECT CASE result
' CASE 7: GetDay$ = "Saturday"
' CASE 1: GetDay$ = "Sunday"
' CASE 2: GetDay$ = "Monday"
' CASE 3: GetDay$ = "Tuesday"
' CASE 4: GetDay$ = "Wednesday"
' CASE 5: GetDay$ = "Thursday"
' CASE 6: GetDay$ = "Friday"
' END SELECT
CASE 1, 3, 5, 7, 8, 10, 12 DaysInMonth = 31
DaysInMonth = 28
IF Year
MOD 4 = 0 THEN DaysInMonth
= 29 'leap year until 2100 -- and I'll be deaded by then, so who cares. :P DaysInMonth = 30
CASE 1: Month$
= "January" CASE 2: Month$
= "February" CASE 8: Month$
= "August" CASE 9: Month$
= "September" CASE 10: Month$
= "October" CASE 11: Month$
= "November" CASE 12: Month$
= "December"
A few quick notes and explanations for things here:
CONST PhotoFolder = ".\National Geographic\" <-- This is where a folder of images are located, which you'd want to use to create a calendar with.
The following is where you can put some notes at the bottom of each page, to have a handy little list of notes hanging up on your wall for the month/year.
DIM SHARED Notes(20) AS STRING
Notes(0) = "1) Steve 555-5555"
Notes(1) = "2) Lori 555-5555"
FOR i = 2 TO 20
Notes(i) = _TRIM$(STR$(i)) + ")"
NEXT
Here, I just select some pictures from that list at random. There may be some duplicates in there, as there's no check to see if the images are duplicated. Personally, I think just choosing 12 images from your drive, putting them in a folder just by themselves, and then loading them all once would be a better way to do things -- but I just wanted to showcase this as a demo so people could tweak it to suit their own needs.
DO
PicNum = INT(RND * PhotoCount) + 1
Pic = _LOADIMAGE(FileList(PicNum), 32)
LOOP UNTIL Pic <> -1
This is set at a 8.5 x 11, 100dpi resolution, so it should print with _PRINTIMAGE just fine (simply change the SLEEP to a printimage statement if you want to print out a page). What you see on your monitor should be almost a perfect match for what you see on your printer. (Some may auto-resize a little to leave room for a border which they don't print to, but the printer should scale for that automatically, if needed.)
A screenshot of one of the calendar pages which I've created for my own personal use is below.