Advertisement

Bitmap Conversion

Started by August 19, 2000 09:14 AM
4 comments, last by Hands 24 years, 4 months ago
Well heres the problem ..My computer doesn''t accept 24 bit video mode ... and I want to create some 16 bit images and use them in some games ... and I know you''re asking yourselves What the heck one thing relates to another... well the problem is that to create graphics I use Paint Shop Pro 5 or Photoshop 5 and they let you create 1,4,8 or 24 bit images...where''s the 16 bit images? My problem can be solved in two ways ... 1-If you know how to set any of these programs to 16 bit bitmaps please tell me how that I''m on my way... or 2-If you know some way to convert 24 bit images to 16 bit images right on the code please tell me and again I''ll be on my way...
I don''t know any program that can create 16bit images.
You must go over each pixel in the image and convert all of them in your code.
Search the forums for archived messages about 24bit->16bit.



The road to success is always under construction
Goblineye EntertainmentThe road to success is always under construction
Advertisement
tornado is right
paint programs dont save in 16 bit, you must convert it manually at runtime(which isn''t very difficult actually)
Quantum, then how is it done? Can you explain or give some example?
Here Hands:

Open the bitmap.
Get the data buffer.
Then:

for (index=0;index < width_of_bitmap*height_of_bitmap;index++)
{
USHORT color;
// temp_buffer is temporary buffer that you need to allocate
color = RGB16_565(temp_buffer[index*3 + 2]>>3,temp_buffer[index*3+1]>>3,temp_buffer[index*3]>>3);

}

RGB16_565:

#define RGB16_565(r,g,b) ((b & 31) + ((g & 63) << 6) + ((r & 31) << 11))

If you need more info about opening the bitmap and everything, search the forums man.



The road to success is always under construction
Goblineye EntertainmentThe road to success is always under construction
Just converting to 565 format is not adequate. Some cards use 555 instead. I don''t have time to write about it now, but I and others have done to in other posts. Search for "pixel format"

Good luck.

This topic is closed to new replies.

Advertisement