Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: Problem in drawing a 16bits image monochrome( black and white)

  1. #1
    Junior Member Newbie
    Join Date
    Feb 2003
    Posts
    6

    Problem in drawing a 16bits image monochrome( black and white)

    Hi,
    can u tell me plz how to draw a 16bits image ( image monochrome(black and white) )
    using "glDrawPixels";Assuming that we have a
    buffer of that image as follow :

    GLshort buffer[256][256];
    what must be each parameter of "glDrawPixesls"
    thanks for help

  2. #2
    Member Regular Contributor
    Join Date
    May 2001
    Location
    Beloit, Wisconsin
    Posts
    473

    Re: Problem in drawing a 16bits image monochrome( black and white)

    Code :
    glDrawPixels(256 /*Width*/, 256 /*Height*/, GL_LUMINANCE /*Image format*/, GL_SHORT /*Data type*/, buffer /*Image pointer*/);
    Hope that helps.

    As a reference: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/opengl/glfunc01_6lbn .asp

    Edit:
    Now that I think about it, you might have to make buffer a pointer first by adding an '&' before buffer... I'm not sure (I don't use glDrawPixels a whole lot).

    [This message has been edited by NitroGL (edited 02-20-2003).]

  3. #3
    Intern Contributor
    Join Date
    Jan 2003
    Posts
    82

    Re: Problem in drawing a 16bits image monochrome( black and white)

    Just out of curiosity:

    Why are you wasting 16 bits per pixel on a monochrome black and white image?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •