Aurigma Forums
»
Graphics Mill
»
Discussions – Graphics Mill
»
Dimensions bitmap and mask bitmap are not the same
Rank: Member
Groups: Guest
Joined: 6/2/2006(UTC) Posts: 4
|
Hi, I'm trying this feature to merge 2 image but it has an exception Dimensions bitmap and mask bitmap are not the same Please help me Thanks This is my code Code:private void Combine2Image()
{
Bitmap sourceBitmap = new Bitmap(Server.MapPath("copyrose.jpg"));
Bitmap maskBitmap = new Bitmap(Server.MapPath("ipod.png"));
Bitmap desBitmap = new Bitmap();
PngEncoderOptions pngEncoderOptions = new PngEncoderOptions(0;
Combiner combiner = new Combiner();
combiner.SourceBitmap = sourceBitmap;
combiner.ApplyMaskTransform(sourceBitmap,maskBitmap,desBitmap);
desBitmap.Save(Server.MapPath("aaa.png"),pngEncoderOptions);
}
Edited by user Wednesday, December 19, 2007 4:33:00 PM(UTC)
| Reason: Not specified
|
|
|
|
Rank: Advanced Member
Groups: Guest
Joined: 8/3/2003(UTC) Posts: 1,070
Thanks: 1 times Was thanked: 12 time(s) in 12 post(s)
|
Hello, If you need to merge two bitmaps into one you should use the following code: Code:Bitmap bitmap1 = new Bitmap(Server.MapPath("copyrose.jpg"));
Bitmap bitmap2 = new Bitmap(Server.MapPath("ipod.png"));
Combiner combiner = new Combiner();
try
{
combiner.SourceBitmap = bitmap1;
combiner.ApplyTransform(bitmap2);
}
finally
{
combiner.Dispose();
}
bitmap2.Save(Server.MapPath("dest.png));
This code sample draws bitmap1 onto bitmap2, and then saves it to PNG format. Edited by user Wednesday, December 19, 2007 4:33:22 PM(UTC)
| Reason: Not specified |
|
|
|
|
Aurigma Forums
»
Graphics Mill
»
Discussions – Graphics Mill
»
Dimensions bitmap and mask bitmap are not the same
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.