By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,737 Members | 1,506 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,737 IT Pros & Developers. It's quick & easy.

Combine bitmaps

P: n/a
Hi,

I need to combine several bitmaps together to form a single bitmap. Can
anyone show me some similar sample code?

Thanks.

AJ
Jun 13 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On Wed, 13 Jun 2007 16:00:00 -0700, John <Jo**@discussions.microsoft.com
wrote:
I need to combine several bitmaps together to form a single bitmap. Can
anyone show me some similar sample code?
How do you want to combine them? Are they all to be drawn one on top of
the other? Do they have transparency? Do you want to tile them somehow?

Without knowing these things, it's impossible to answer your question.
However, here's the basic idea:

Bitmap bmpDestination = new Bitmap(sizeNew.Width, sizeNew.Height);

using (Graphics gfx = Graphics.FromImage(bmpDestination))
{
gfx.DrawImage(bmpSource, new Point());
}

That would take an existing bitmap "bmpSource" and draw it placed at the
upper-left corner of a new bitmap "bmpDestination".

For your own needs, you may modify various things like putting the code in
a loop that enumerates several bitmaps, calculates new positions for the
bitmaps, changing the composition mode, etc.

Pete
Jun 14 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.