I am passing an image to a one-dimensional array. This must be passed to another two-dimensional array from which I must graph the saved image. the image has its beginning in 1078
and ends in 3078
, the problem that I have is to graph the image since it is running graph.
This is the function that I have.
void pasoArreglo(FILE* Archivo) {
char datos[3078];
fread(datos, 1, 3078, Archivo);
char dimenciones[80][25];
for (int y = 0; y < 25; y++) {
for (int x = 0; x < 80; x++) {
dimenciones[x][y] = datos[1078 + ((y * 2) + x)];
}
}
char Rcolor = 0, Gcolor = 0, Bcolor = 0;
for (int y = 24; y >= 0; y--) {
for (int x = 0; x < 80; x++) {
if (dimenciones[x][y] & 0x1) { Rcolor = FOREGROUND_RED; }
if (dimenciones[x][y] & 0x2) { Gcolor = FOREGROUND_GREEN; }
if (dimenciones[x][y] & 0x4) { Bcolor = FOREGROUND_BLUE; }
gotoxy(x, y);
setColor(Rcolor | Gcolor | Bcolor);
printf("%c", 219);
Rcolor = 0;
Gcolor = 0;
Bcolor = 0;
}
}
}