Hi Matt!
Well heres what i tried :
for(int k = 0;k < height*width; k++)
{
int y = k/width;
int x = k%width;
int n = ((y-1)*width)+x;
Bytes[n] = pbmpBytes[n-y];
}
In this case pbmpBytes is the buffer holding the bytes for the image. The size of this buffer is height*width. "Bytes" is...
Hi Matt!
Any other ideas for the alignment. I have tried a lot over this i.e. to get the alignment and also adjusting the height and the width in such a way that they are divisible by 4 but it hardly worked. And another thing is i also get more than one images i.e. 3 images in the same...
Hi Matt!
Yes it kind of looks that way. The image is tilted diagonally. The image that i want forms a diagonal going from left top corner to the right bottom of the rectangular area that holds it.
Hi Matt!
The code you sent for creating a bitmap file really helped a lot. Now i am able to write the bitmap into a file without any problem. But now i guess there is a problem with the buffer that i am using to write into the file coz the image that i get out of the buffer is not straight...
Hi Matt!
The code you sent works fine i.e. generates a black bitmap without any problem.Can you send me an example of a byte buffer which generates an image? Because i think there is some problem with the byte buffer i am using.
Thanks a lot for your prompt replies and help.
Hi Matt!
The code you sent works fine i.e. generates a black bitmap without any problem.Can you send me an example of a byte buffer which generates an image? Because i think there is some problem with the byte buffer i am using.
Thanks a lot for your prompt replies and help.
Hi Matt!
Thanks a lot for your help. Actually the program you have sent is right but then the problem is not solved with the code u sent. The result is the same. Any other possible reason for the problem? The bitmap i am trying to write to a file is also a grayscale bitmap.
Hi!
I am trying to create a bmp file with the following code:
CDibClass::CDibClass()
{
memset(&m_bmpInfoHdr, 0, sizeof(BITMAPINFOHEADER));
m_pBits = NULL;
m_pBMI = NULL;
}
CDibClass::~CDibClass()
{
CloseAll();
}
void CDibClass::CloseAll()
{
if (m_pBMI)
free(m_pBMI);
if (m_pBits)...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.