Solved

Bitmap header and palette information

Posted on 2014-03-05
1
278 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

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

Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
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.

808 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