Solved

Bitmap header and palette information

Posted on 2014-03-05
1
280 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Suggested Solutions

Title # Comments Views Activity
Building cUrl in Windows v7.43.0 4 39
How to split this in C++ 4 119
How do i run a c++ file? 15 52
C++ help/ Toy problem 19 56
Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

726 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