Solved

Bitmap header and palette information

Posted on 2014-03-05
1
271 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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
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…

762 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

11 Experts available now in Live!

Get 1:1 Help Now