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: Save Current Frame in 32bit-Bitmap -> How?

  1. #1
    Junior Member Newbie
    Join Date
    Mar 2010
    Posts
    1

    Save Current Frame in 32bit-Bitmap -> How?

    Hello,

    im im using GLScene in combination with Delphi and i was trying to Save a Picture from the current Frame.

    At the scene is only 1 Cube, nothing else.
    As result i would like to receive a 32Bit-Bitmap or PNG or TGA, where i can see the cube and inside the alpha-Channel only the cube is white and rest is black.

    Is there a chance or way to do this?
    And if yes, could you show me a way how to do this?

    Thank you
    Tom

  2. #2
    Intern Contributor
    Join Date
    Sep 2009
    Posts
    55

    Re: Save Current Frame in 32bit-Bitmap -> How?

    The glReadPixels command can retrieve raw image data from the framebuffer, including the alpha channel data.

    You will have to format the raw pixel data into a PNG, TGA, or other file format yourself before writing to disk. OpenGL does not provide file-format conversion services.

  3. #3
    Advanced Member Frequent Contributor Ehsan Kamrani's Avatar
    Join Date
    May 2005
    Location
    Iran
    Posts
    547

    Re: Save Current Frame in 32bit-Bitmap -> How?

    I have used this method to create a video of our game( We saved an screen shot each frame, then we converted all of those TGA file to one video file ) But I didn't add an alpha channel to the final TGA image.
    The code has been written in pure C++ . Are you interested to see the code? I have no idea about Delphi and can't convert this code to that language
    <span style="color: #006600">-Ehsan-</span>

Posting Permissions

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