Thread: Bitmap Pixel

  1. #1
    Alextrons
    Guest

    Bitmap Pixel

    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

  2. #2
    Former Member
    Join Date
    Oct 2001
    Posts
    955
    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

  3. #3
    Alextrons
    Guest
    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.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How do read bitmap x,y pixel coords?
    By Queatrix in forum Game Programming
    Replies: 1
    Last Post: 09-06-2005, 05:30 PM
  2. OpenGL -- Bitmaps
    By HQSneaker in forum Game Programming
    Replies: 14
    Last Post: 09-06-2004, 04:04 PM
  3. bitmap not going onto screen
    By stallion in forum Windows Programming
    Replies: 4
    Last Post: 02-22-2003, 10:07 AM
  4. pixel in Bitmap??
    By SuperNewbie in forum Game Programming
    Replies: 5
    Last Post: 02-01-2003, 01:43 PM
  5. Saving a bitmap.
    By jdinger in forum Game Programming
    Replies: 4
    Last Post: 05-01-2002, 01:40 PM