Welcome Guest! You need to login or register to make posts.

Notification

Icon
Error

Options
Go to last post Go to first unread
ldehart0556  
#1 Posted : Tuesday, May 30, 2006 2:50:10 AM(UTC)
ldehart0556

Rank: Member

Groups: Member
Joined: 5/30/2006(UTC)
Posts: 6

I have a blank bitmap that I drew text on and then converted to CMYK ... now I'd like to blend or combine that image on top of a CMYK bitmap. Is there a way to do that?

Lisa
Dmitry  
#2 Posted : Tuesday, May 30, 2006 8:11:07 PM(UTC)
Dmitry

Rank: Advanced Member

Groups: Member, Administration, Moderator
Joined: 8/3/2003(UTC)
Posts: 1,070

Thanks: 1 times
Was thanked: 12 time(s) in 12 post(s)
Hello Lisa,

Of course, you can do it. You should use Combiner transformation which allows you to combine two images. Here is small code sample, which draws text string onto bitmap, converts it to cmyk32 and then draws it onto another cmyk32 bitmap.
Code:
Aurigma.GraphicsMill.Bitmap bmp1 = new Aurigma.GraphicsMill.Bitmap(300, 100, Aurigma.GraphicsMill.PixelFormat.Format24bppRgb);
Aurigma.GraphicsMill.Bitmap bmp2 = new Aurigma.GraphicsMill.Bitmap(@"d:/images/test/cmyk.jpg");

// Draw text string on bmp1.
Aurigma.GraphicsMill.Drawing.GdiGraphics graphics = bmp1.GetGdiGraphics();
Aurigma.GraphicsMill.Drawing.Font font = new Aurigma.GraphicsMill.Drawing.Font("Arial", 14);
try
{
	graphics.DrawString("Aurigma Graphics Mill for .NET", font, new Aurigma.GraphicsMill.Drawing.SolidBrush(Aurigma.GraphicsMill.RgbColor.Blue), 10, 10);
}
finally
{
	font.Dispose();
	graphics.Dispose();
}

// Convert bmp1 from rgb24 to cmyk32.
bmp1.ColorManagement.ConvertToContinuous(Aurigma.GraphicsMill.ColorSpace.Cmyk, true, false);

// Draw bmp1 onto bmp2.
Aurigma.GraphicsMill.Transforms.Combiner combiner = new Aurigma.GraphicsMill.Transforms.Combiner();
try
{
	combiner.SourceBitmap = bmp1;
	combiner.ApplyTransform(bmp2);
}
finally
{
	combiner.Dispose();
}

// Save bmp2 as result.
bmp2.Save(@"c:/1.tiff");

Edited by user Wednesday, December 19, 2007 4:36:31 PM(UTC)  | Reason: Not specified

Sincerely yours,
Dmitry Sevostyanov

UserPostedImage Follow Aurigma on Twitter!
ldehart0556  
#3 Posted : Friday, June 2, 2006 12:34:12 AM(UTC)
ldehart0556

Rank: Member

Groups: Member
Joined: 5/30/2006(UTC)
Posts: 6

Thank you so much for the fast reply.
That works great.
Now, how do I adjust the opacity of the background on the text layer so that a gigantic black box doesn't blend on top of the cmyk picture?

Thank you!
Lisa
Dmitry  
#4 Posted : Friday, June 2, 2006 6:44:30 PM(UTC)
Dmitry

Rank: Advanced Member

Groups: Member, Administration, Moderator
Joined: 8/3/2003(UTC)
Posts: 1,070

Thanks: 1 times
Was thanked: 12 time(s) in 12 post(s)
Hello Lisa,

You should use transparent background of temporary image with text. Here you can see code sample which merges two source CMYK images together and then adds text string. In your case you just should use one source bitmap instead of couple.
Sincerely yours,
Dmitry Sevostyanov

UserPostedImage Follow Aurigma on Twitter!
Users browsing this topic
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.