I have an eight by eight bitmap box (24 bit) with four colors, one in each quadrant. I am trying to enlarge it to sixteen by sixteen. I am concentrating on the blue and green sections. The first attempt looks like this:
The second attempt is supposed to double each row and results in this:
The pixels do enlarge but the rows are one color, not blue and green.
The code is as follows:
if ((i % 12 == 0) && (i != 0))
{
if (wenthere == 2)
{
wenthere = 0;
i = i - 12;
}
wenthere++;
}
And the full code is here:
while (1)
{
count++;
i = fgetc(file);
if (feof(file)) {
fclose(file);
break;
}
}
i = 0;
file = fopen(r_path, "r");
fseek(file, 54, SEEK_SET);
int var3 = 0;
do {
var3 = fgetc(file);
if (feof(file)) {
fclose(file);
break;
}
allinthexdecimal[i] = var3;
i++;
element_index++;
} while (1);
int j = 0;
i = 0;
int wenthere = 2;
//hex image is 822 - 54 = 768 % 6 % 2 = 64
for (int z = 0; z < 64; z++)
{
allnewinthexdecimal[j] = allinthexdecimal[(i)];
std::cout << allnewinthexdecimal[j] << " ";
allnewinthexdecimal[(j + 1)] = allinthexdecimal[(i + 1)];
std::cout << allnewinthexdecimal[j + 1] << " ";
allnewinthexdecimal[(j + 2)] = allinthexdecimal[(i + 2)];
std::cout << allnewinthexdecimal[j + 2] << " ";
allnewinthexdecimal[(j + 3)] = allinthexdecimal[(i)];
std::cout << allnewinthexdecimal[j + 3] << " ";
allnewinthexdecimal[(j + 4)] = allinthexdecimal[(i + 1)];
std::cout << allnewinthexdecimal[j + 4] << " ";
allnewinthexdecimal[(j + 5)] = allinthexdecimal[(i + 2)];
std::cout << allnewinthexdecimal[j + 5] << " ";
i = i + 3;
j = j + 6;
if ((i % 12 == 0) && (i != 0))
{
if (wenthere == 2)
{
wenthere = 0;
i = i - 12;
}
wenthere++;
}
}
i = 96;
for (int z = 0; z < 64; z++)
{
allnewinthexdecimal[j + 0] = allinthexdecimal[i + 0];
allnewinthexdecimal[(j + 1)] = allinthexdecimal[(i + 1)];
allnewinthexdecimal[(j + 2)] = allinthexdecimal[(i + 2)];
allnewinthexdecimal[(j + 3)] = allinthexdecimal[(i+0)];
allnewinthexdecimal[(j + 4)] = allinthexdecimal[(i + 1)];
allnewinthexdecimal[(j + 5)] = allinthexdecimal[(i + 2)];
i = i + 3;
j = j + 6;
}
Any guidance or help would be appreciated.
Josheir