Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old May 23rd, 2006, 5:02 PM   #1
JawaKing00
Newbie
 
Join Date: Sep 2004
Posts: 29
Rep Power: 0 JawaKing00 is on a distinguished road
Converting a Bitmap to raw hex. Don't know where to start.

Alright, I am writing a program in C that will display images onto a screen. The screen is 256x128 and monochrome. I just need to get the image data out of a black and white .bmp that I can create in Paint or something.

I am looking at writing a C++ program that will take the .bmp images and spit out the image data in easy to read hex numbers. I've looked at the EasyBMP libraries, but I really don't know if they have what I need. For that matter I don't even really know what I need.

If anyone could point me in a direction to find some pointers on what needs to be done, I would appreciate it. I assume I can somehow read in the .bmp file and cut out the unnecessary stuff, but I'm not really sure.

Thanks.
JawaKing00 is offline   Reply With Quote
Old May 23rd, 2006, 5:27 PM   #2
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
If you're planning on rolling your own, just get the format in hand and go to it. Bear in mind that there are several flavors of .bmp file. The formats are readily found on MSDN, as well as a number of other helpful things, structures and such, for breaking them down.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old May 23rd, 2006, 5:52 PM   #3
lectricpharaoh
SEXY SHOELESS GOD OF WAR!
 
lectricpharaoh's Avatar
 
Join Date: Jun 2005
Location: Wet west coast of Canada
Posts: 1,193
Rep Power: 5 lectricpharaoh will become famous soon enough
Quote:
Originally Posted by JawaKing00
Alright, I am writing a program in C
And then...

Quote:
Originally Posted by JawaKing00
I am looking at writing a C++ program
You need to pick.
Quote:
Originally Posted by JawaKing00
If anyone could point me in a direction to find some pointers on what needs to be done, I would appreciate it. I assume I can somehow read in the .bmp file and cut out the unnecessary stuff, but I'm not really sure.
Try checking out wotsit.org. They have lots of file format specifications.

Once you've familiarized yourself with the BMP format, it should be relatively trivial to read in the image data from the bitmap file, then write it out however you like. Another option, if you are targeting Windows, is to use the bitmap functions available there; you can load bitmaps into memory device contexts, then play with the data that way.
__________________
And once again, Probability proves itself willing to sneak into a back alley and service Drama as would a copper-piece harlot.
- Vaarsuvius, Order of the Stick
lectricpharaoh is online now   Reply With Quote
Old May 23rd, 2006, 6:18 PM   #4
hbe02
Hobbyist Programmer
 
hbe02's Avatar
 
Join Date: Mar 2006
Location: Lebanon
Posts: 148
Rep Power: 3 hbe02 is on a distinguished road
I used this library for a project earlier.. check it out.. very usefull.. it was some dudes thesis.http://cimg.sourceforge.net/
You can download the package.. all u need to use is a CImg.h file. all the rest are examples and some brief presentation on the functions of this library.
There is a detailed tutorial on how to use the library on the website itself
hbe02 is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 11:45 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC