Solved

Loading a 32 bit bitmap

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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

What is RenderMan: RenderMan is a not any particular piece of software. RenderMan is an industry standard, defining set of rules that any rendering software should use, to be RenderMan-compliant. Pixar's RenderMan is a flagship implementation of …
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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

747 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now