-
Notifications
You must be signed in to change notification settings - Fork 7
Image(i,j)->Red is not working #2
Copy link
Copy link
Open
Description
I saw the page https://bytes.com/topic/c/answers/580148-bitmap-hexadecimal-conversion
It told me that if I use
cout << "red: " << Image(i,j)->Red << "\t"
<< "green: " << Image(i,j)->Green << "\t"
<< "blue: " << Image(i,j)->Blue << endl;
this code, I will get R/G/B value of bmp file
but it is not work.
this is my code.
when I use Image(i,j), It works
but when I use Image(i,j)->Red it is not work
#include "EasyBMP.h"
#include
using namespace std;
int main()
{
ofstream fout;
fout.open("long.hex");
BMP Image;
Image.ReadFromFile("test_red.bmp");
for (int j = 0; j < Image.TellHeight(); j++)
{
for (int i = 0; i < Image.TellWidth(); i++)
{
fout << hex << Image(i, j) << endl;
}
cout << endl;
}
//for (int j = 0; j < Image.TellHeight(); j++)
//{
// for (int i = 0; i < Image.TellWidth(); i++)
// {
// cout << Image(i, j)->Red << "\t"
// << Image(i, j)->Green << "\t"
// << Image(i, j)->Blue << endl;
// }
//
//}
return 0;
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels