Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Bitmap header and palette information

Posted on 2014-03-05
1
Medium Priority
?
288 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 1500 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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

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

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…
Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
Suggested Courses

618 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