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

Notification

Icon
Error

Options
Go to last post Go to first unread
rawdrib  
#1 Posted : Tuesday, February 06, 2007 7:36:31 AM(UTC)
rawdrib

Rank: Member

Groups: Member
Joined: 2/6/2007(UTC)
Posts: 2

I am trying to use the GDIGraphics object to combine two JPEG's into one image, and add a border around the images. I want the border to be a hard edge, where the pixel color of the border does not affect the images. Everytime i do this, however, the edges "blend" with the images and depending on the color of the border, it creates an ugly gray line. Here's the code i'm trying to use:
Code:
   Dim canvas As New Aurigma.GraphicsMill.Drawing.GdiGraphics(bgBmp)

                canvas.DrawImage(profileImg, New PointF(picX, picY), Aurigma.GraphicsMill.Transforms.CombineMode.Copy, 1)
                canvas.DrawImage(pantsImg, New PointF(pantsX, pantsY), Aurigma.GraphicsMill.Transforms.CombineMode.Copy, 1)
                canvas.DrawString(imgStyle.TextValue, New Drawing.Font("Arial", 18, Drawing.FontStyle.Bold, GraphicsUnit.Pixel), _
                                New SolidBrush(Drawing.ColorTranslator.FromHtml(imgStyle.TextHex)), _
                                New Drawing.Point(DUBorderSize + 20, _
                                combHeight - DUBottomHeight - Math.Ceiling(Convert.ToDouble(DUBorderSize) / 2)))
                canvas.DrawRectangle(New Pen(Drawing.ColorTranslator.FromHtml(imgStyle.BorderColorHex), DUBorderSize), _
                                1, 1, DUWidth - DUBorderSize, profileImg.Height + (DUBorderSize))
                canvas.DrawRectangle(New Pen(Drawing.ColorTranslator.FromHtml(imgStyle.BorderColorHex), DUBorderSize), _
                                1, 1, DUWidth - DUBorderSize, profileImg.Height + (DUBorderSize))
 
                bgBmp.Save(sampleSavePath, New Aurigma.GraphicsMill.Codecs.JpegEncoderOptions(100, False))
                bgBmp.Dispose()
Any suggestions on accomplishing this task without losing the hard edges? Thanks, Brian

Edited by user Tuesday, December 18, 2007 5:09:55 PM(UTC)  | Reason: Not specified

Dmitry  
#2 Posted : Tuesday, February 06, 2007 6:32:35 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 Brian, Could you try to save result image to TIFF without compression? Most likely this effect will disappear. Unfortunately it is limitation of JPEG format - this format is lossy, so when a JPEG image is decoded - some pixels can be blended.
Sincerely yours, Dmitry Sevostyanov UserPostedImage Follow Aurigma on Twitter!
rawdrib  
#3 Posted : Wednesday, February 07, 2007 6:11:40 AM(UTC)
rawdrib

Rank: Member

Groups: Member
Joined: 2/6/2007(UTC)
Posts: 2

Unfortunately I'm stuck with JPEG format. Any ideas on how I might at least cut back the amount of this? Would saving the image as TIFF and then saving as JPEG make any difference? Thanks, Brian
Dmitry  
#4 Posted : Wednesday, February 07, 2007 1:10:53 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 Brian, Could you submit case with your source JPEG images?

Edited by user Thursday, May 22, 2008 7:16:14 PM(UTC)  | Reason: Not specified

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.