This repository was archived by the owner on Oct 11, 2022. It is now read-only.
forked from nickelsworth/swag
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path0099.pas
More file actions
97 lines (68 loc) · 2.56 KB
/
Copy path0099.pas
File metadata and controls
97 lines (68 loc) · 2.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
{
The purpose of this program is to convert an ICON into an INC file.
╔════════════════════════════════════════╗
║ ║░
║ AVONTURE CHRISTOPHE ║░
║ AVC SOFTWARE ║░
║ BOULEVARD EDMOND MACHTENS 157/53 ║░
║ B-1080 BRUXELLES ║░
║ BELGIQUE ║░
║ ║░
╚════════════════════════════════════════╝░
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
}
FUNCTION No_Extension (st : String) : String;
VAR
wExtension : Word;
BEGIN
wExtension := Pos('.', st);
Delete (St, wExtension, Length(st));
No_Extension := st;
END;
CONST
IcoSize = 766;
FileName = 'TEST.ICO';
TYPE
Buffer = ARRAY[1..IcoSize] OF Byte;
VAR
fIco : File of Buffer;
fSource : Text;
Buf : ^Buffer;
I : Word;
BEGIN
IF PARAMCOUNT=0 THEN
BEGIN
Writeln ('');
Writeln ('AVC Software (c) AVONTURE Christophe');
Writeln ('');
Writeln ('');
Writeln ('Convert an ICO file to a pascal source file.');
Writeln ('Type ICO2PAS followed by the name of the ICO (extension must be there).');
Writeln ('');
Writeln (' Example ICO2PAS WINWORD.ICO will create a WINWORD.INC file');
Writeln ('');
Halt;
END;
GetMem (Buf, IcoSize);
Assign (fIco, ParamStr(1));
FileMode := 0;
Reset (fIco);
Read (fIco, Buf^);
Close (fIco);
Assign (fSource, No_Extension (FileName)+'.INC');
FIleMode := 1;
Rewrite (fSource);
Writeln (fSource, 'Const '+No_Extension (FileName)+'_ICO : Array[1..766] of Byte =');
FOR I := 1 TO IcoSize-1 DO
IF I = 1 THEN
Write (fSource, ' (', Buf^[I],',')
ELSE IF I Mod 20 = 19 THEN
BEGIN
Writeln (fSource, Buf^[I],',');
Write (fSource, ' ');
END
ELSE
Write (fSource, Buf^[I],',');
Write (fSource, Buf^[IcoSize],');');
Close (fSource);
END.