Skip to main content
GameDev.net gamedev.net
🔒 Locked

Image question

Started by yuppies Aug 30, 2006 at 4:29 AM 2 replies 1.2k views
Original Post
yuppies
yuppies
how can i merge two bitmaps into one? for example i want to merge two 240x320 image into one 480x320 image (merge side by side) or into 240x640 (top and bottom)
Ezbez
Ezbez
1. Open up MS Paint.
2. Open one of the bitmaps.
3. Open another MS Paint.
4. Open the other bitmap.
5. Select all of the second bitmap and then copy it to the clip board.
6. Go back into the first MS Paint, and expand the image size to 480x320
7. Paste in the second bitmap from the clip board.
8. Move it to the correct position so that it no longer covers up the first one.
9. Save the file.

There you have it. But if you want to do it inside a program, well, you'll have to tell us your language, what API you use for loading in images, what you use for graphics, etc.
yuppies
yuppies
i meant the programming side .. sori i didnt mention above.

perhaps i should requote it to;

How can i merge 2 bitmaps inside my program without using any API? just a simple byte handling (2 unsigned char buffer merge into 1 big unsigned char buffer).
BYTE* src1; //240x320
BYTE* src2; //240x320
BYTE* dist; //either 480x320 or 240x640
Enselic
Enselic
After you have loaded the bitmaps, you simply merge the data. If you want to combine #2 below #1, just add the actual bitmap data at the end. To put #2 to the right of #1, you "mix" the actual bitmap data by inserting every row n from #2 after row n of #1. After the merging, you write the data to a file.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.