[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Loading a 32 bit bitmap

Posted on 2004-04-19
2
Medium Priority
?
212 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
  • 2
2 Comments
 
LVL 4

Accepted Solution

by:
void_main earned 2000 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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…
As game developers, we quickly learn that Artificial Intelligence (AI) doesn’t need to be so tough.  To reference Space Ghost: “Moltar, I have a giant brain that is able to reduce any complex machine into a simple yes or no answer. (http://www.youtu…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses

830 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