Solved

Loading a 32 bit bitmap

Posted on 2004-04-19
2
208 Views
Last Modified: 2013-12-26
Translation to 32 bit instead of 24 please:

Glu.gluBuild2DMipmaps(Gl.GL_TEXTURE_2D, 3,
NWidth, NHeight,
Gl.GL_BGR_EXT, Gl.GL_UNSIGNED_BYTE,
pViewOfFile1);
0
Comment
Question by:rossryan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 4

Accepted Solution

by:
void_main earned 500 total points
ID: 10897398
typedef struct pixel_32bit_s
{
   unsigned char r, g, b, alpha;
} pixel_32bit_t;

typedef struct pixel_24bit_s
{
   unsigned char r, g, b;
} pixel_24bit_t;

to convert it do the following:

for each pixel
{
   pixel32.r = pixel24.r;
   pixel32.g = pixel24.g;
   pixel32.b = pixel24.g;
   pixel32.alpha = 0;
}

thats it.
(to use 16 bit [obsolete] each r, g and b has 5 bits and there is a padding bit)

regards
void_main
0
 
LVL 4

Expert Comment

by:void_main
ID: 10915645
Small mistake:
it should be this

pixel32.b = pixel24.b;
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Artificial Intelligence comes in many forms, and for game developers, Path-Finding is an important ability for making an NPC (Non-Playable Character) maneuver through terrain.  A* is a particularly easy way to approach it.  I’ll start with the algor…
Recently, in one of the tech-blogs I usually read, I saw a post about the best-selling video games through history. The first place in the list is for the classic, extremely addictive Tetris. Well, a long time ago, in a galaxy far far away, I was…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question