Bitmap Conversion
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
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
tornado is right
paint programs dont save in 16 bit, you must convert it manually at runtime(which isn''t very difficult actually)
paint programs dont save in 16 bit, you must convert it manually at runtime(which isn''t very difficult actually)
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
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
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement