Hi, I'm plotting pixel into a bitmap memory programatically and found out that the 0,0 coordinates of bitmap is in the lower left corner, Is there anybody here know how to invert it so that the 0,0 coordinates will become in the upper left corner?

Thanks for the help in advance...

Alextrons

10-23-2001

oskilian

You must be wrong, the 0,0 IS the top-left corner, well, at least in all the programming tools I use (the major ones)

Oskilian

10-28-2001

Alextrons

Yea, I wonder also because when I used the code below its already in the upper left.

The code below is already in the Upper left corner:

VERIFY(m_bmp.LoadBitmap(IDB_TEST));
m_bmp.GetBitmap(&m_bmpinfo);

DWORD imagesize=m_bmpinfo.bmHeight*m_bmpinfo.bmWidth;

BYTE* pBits;
pBits=new BYTE[imagesize];

//trying to draw a line at the top of the bitmap;
for(int i=0;i<m_bmpinfo.bmWidth;i++)
pBits[i]=255;

m_bmp.SetBitmapBits(imagesize,(LPVOID)pBits);

However I still need help for this code because when I use BYTE for pBits it will not locate at desired location, while when I use SHORT it will plot to a desired location but the color is different.

Please help me for this?

By the way I use StretchDIBits() API function before to display bitmap and still I don't know why its 0,0 is in the Lower Left corner.