Solved

Bitmap header and palette information

Posted on 2014-03-05
1
272 Views
Last Modified: 2014-03-14
Hi ,
Can any one help me with bitmap creation . I need to create header for bitmap and add palette information (not 24 bit bitmap) in plane C++ so it can be used both in Linux and windows.
0
Comment
Question by:mastiSoft
1 Comment
 
LVL 25

Accepted Solution

by:
SStory earned 500 total points
ID: 39917564
This is a well known format. These links should help:
http://en.wikipedia.org/wiki/BMP_file_format
http://www.fileformat.info/mirror/egff/ch03_03.htm

http://www.cplusplus.com/forum/general/6500/

Check out BITMAPINFOHEADER
http://msdn.microsoft.com/en-us/library/windows/desktop/dd183376%28v=vs.85%29.aspx

Is there any particular problem you are having.  I'd say since Microsoft is still unfortunately more popular that other OSs have to read any BMP format that produce so I might just do it their way.

Here are their structures related to bitmaps:
http://msdn.microsoft.com/en-us/library/windows/desktop/dd183392%28v=vs.85%29.aspx

BITMAP
BITMAPCOREHEADER
BITMAPCOREINFO
BITMAPFILEHEADER
BITMAPINFO
BITMAPINFOHEADER
BITMAPV4HEADER
BITMAPV5HEADER
BLENDFUNCTION
COLORADJUSTMENT
DIBSECTION
GRADIENT_RECT
GRADIENT_TRIANGLE
RGBQUAD (OF COURSE THAT IS A, R, G, B (TRANSPARENCY(ALPHA), RED, GREEN, BLUE)
RGBTRIPLE
SIZE
TRIVERTEX

I have read a bitmap before using these structures, but never needed to make one. I'd think you just fill them out with the correct info, and one structure uses one or more of the others.  there are probably a lot of RGBQUAD instances for example. I seem to also remember something about things being upside down and having to interpret -numbers in a special way.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

867 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

21 Experts available now in Live!

Get 1:1 Help Now