Solved

Loading a 32 bit bitmap

Posted on 2004-04-19
2
207 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

Industry Leaders: 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

Suggested Solutions

Title # Comments Views Activity
word search puzzle 2 1,193
AngelList.co - how do I see what is being funded? 6 389
count7 challenge 12 132
Any Fantasy Football Brute force AI suggestions? 2 83
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…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

730 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