How to I edit bitmaps?

Started by
3 comments, last by ManaStone 22 years, 7 months ago
I want to make a program where is takes two bitmaps and makes it into one. I want to add the the two buffers together so that they are to the side of each other, and the so that if any extra pixes that might be created,from when one bitmap is longer than the other, they will be black. How do I edit the buffer area? Is there some way I can turn the info into an array?
-----------------------------Download my real time 3D RPG.
Advertisement
This may not be the best way to do it, but it''s what I would do.

Study the BMP files with a hex editor, and figure out what does what... If you need help with that part you can ICQ me at 1661241 or email me at aaronsj@hotmail.com

After you know what does what in a BMP file, then just read each one into arrays by using fopen... one array for the header, and another array containing the pixel information... so that''s 2 arrays for each BMP. if it''s an 8 bit BMP you may need another array for pallette information, but I would suggest just using 24 bit BMPs.

After you have each BMP into the appropriate arrays, you should be able to write them to a file... first a header... with the appropriate height and widths... to get the widtch for what you are trying to do you''d just add the 2 widths together. and the height would just be the highest of the 2.

When you output it to the new file, you would first want to read one line from the first bmp, then a line from the second, and repeat until you reach the end(A line being one complete row of pixels).

Just email me or ICQ me if you hae any questions.


EAX
EAX
Go and download the BMP file format from wotsit.org. Dont bother messing around with a hex editor as EAX suggested
--------------------Go Stick Your Head In A Pig
Next time, please use the term "Windows Bitmap" (note the capitalization). I ask this because a "bitmap" is simply an array of bits—as the term suggests—that may or may not have anything to do with imagery, and if it is an image, it contains only on/off data (as, again, the term "bitmap" suggests). Although I can determine your meaning from the context and common usage, it helps to be specific.
Ok, Thanks a lot. I think I figured out what to do.
-----------------------------Download my real time 3D RPG.

This topic is closed to new replies.

Advertisement