![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Sep 2004
Posts: 29
Rep Power: 0
![]() |
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. |
|
|
|
|
|
#2 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
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 |
|
|
|
|
|
#3 | |||
|
SEXY SHOELESS GOD OF WAR!
![]() Join Date: Jun 2005
Location: Wet west coast of Canada
Posts: 1,193
Rep Power: 5
![]() |
Quote:
Quote:
![]() Quote:
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 |
|||
|
|
|
|
|
#4 |
|
Hobbyist Programmer
Join Date: Mar 2006
Location: Lebanon
Posts: 148
Rep Power: 3
![]() |
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 |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|