-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSource.cpp
More file actions
51 lines (37 loc) · 846 Bytes
/
Source.cpp
File metadata and controls
51 lines (37 loc) · 846 Bytes
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
#include "Functions.h"
int main()
{
al_init();
al_init_image_addon();
char BitmapName[100];
int notFound;
printf("Please enter the name of the bitmap: (format: <nameOfTheFile> - with .bmp): \n");
scanf("%s", BitmapName);
ALLEGRO_BITMAP *bmp = NULL;
bmp = al_load_bitmap(BitmapName);
if (bmp)
{
printf("Bitmap was found !");
notFound = 0;
}
else {
printf("Bitmap was not found !\n");
notFound = 1;
}
if (!notFound)
{
resizeBmp(bmp);
char AsciiDictionary[19] = "@#%xo+<>/;:,.";
FILE *fpText = fopen("graphic.txt", "w+");
// conversion from bitmap to ascii
convertToAscii(bmp, fpText, AsciiDictionary);
al_unlock_bitmap(bmp);
printf("Ascii picture created...\n");
fclose(fpText);
}
printf("Press enter to exit the program...\n");
al_destroy_bitmap(bmp);
getchar();
getchar();
return 0;
}