thes days I'm trying to do something that I totaly ignore how to satrt it, thus I hope you could help me acheive my goal. here's my problem:
I wanna transforme a text file containing data of type double into an image.i.e. the firsr line of my file represents the x-coordinates information and the first column represents the y-coordinates information, and the i would like to represent the rest of data as coulours depending on their intensity. the figure bellow shows a representation of the data in my text file:
Here is an example of using the EasyBMP header to create a bitmap image. You will have to change the image size, and read in the values from your text file and set the pixel values accordingly.
#include "EasyBMP.h"
int main()
{
BMP AnImage;
// Set size to 640 × 480
AnImage.SetSize(640,480);
// Set its color depth to 32-bits
AnImage.SetBitDepth(32);
for (int i=1;i<100;i++)
{
for (int j=1; j<100; j++)
{
// Set one of the pixels
AnImage(i,j)->Red = 0;
AnImage(i,j)->Green = 0;
AnImage(i,j)->Blue = 0;
AnImage(i,j)->Alpha = 0;
}
}
AnImage.WriteToFile("Output.bmp");
return 0;
}