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

Notification

Icon
Error

Options
Go to last post Go to first unread
tneagle99  
#1 Posted : Thursday, February 15, 2007 9:54:39 AM(UTC)
tneagle99

Rank: Member

Groups: Member
Joined: 2/15/2007(UTC)
Posts: 18

Hi There,

We have been using Graphics Mill for a proof of concept. Our problem is that we need to combine 4 trapezoidal images together as one i.e. as a box/frame when you piece them together.

To do this, we have first constructed the rectangles and are then using the Combiner class and applying a mask to get the trapeziums required. Sample code for this is below:

method is passed the Bitmap called 'side' and then:

Code:
Aurigma.GraphicsMill.Bitmap mask = side.GetEmptyMask();
Aurigma.GraphicsMill.Drawing.GdiGraphics g = mask.GetGdiGraphics();
Aurigma.GraphicsMill.Drawing.SolidBrush brush = new Aurigma.GraphicsMill.Drawing.SolidBrush();
brush.Color = Aurigma.GraphicsMill.RgbColor.White;
System.Drawing.Point[] points = { 
	new System.Drawing.Point(0, 0),
	new System.Drawing.Point(side.Width, 0),
	new System.Drawing.Point(side.Width - side.Height, side.Height),
	new System.Drawing.Point(side.Height, side.Height)
				};
g.FillPolygon(brush, points);

Aurigma.GraphicsMill.Transforms.Combiner c = new Aurigma.GraphicsMill.Transforms.Combiner();
Aurigma.GraphicsMill.Bitmap maskResult = new Aurigma.GraphicsMill.Bitmap(side.Width, side.Height, side.PixelFormat);
c.CombineMode = Aurigma.GraphicsMill.Transforms.CombineMode.Alpha;
c.SourceBitmap = side;
c.ApplyMaskTransform(maskResult, mask);

return maskResult;

This seems to be working correctly for us, which is great - from this we can generate 4 trapezium shapes i.e. rectangles with 2 trianglar pieces sliced off. Or so it seems - the images which are produced have a trapezoidal shape of the image we require and then two black triangles (which we believe are transparent).

The problem is that then, we need to combine the 4 sides and we do this by using the following code similar to the following:

method is passed bitmaps topSide, leftSide, rightSide and bottomSide and then...

Code:
Aurigma.GraphicsMill.Bitmap final = new Aurigma.GraphicsMill.Bitmap(workingBitmap);

final = drawBitmapOnBitmap(topSide, final, 0, 0);
final = drawBitmapOnBitmap(leftSide, final , 0, 0);
final = drawBitmapOnBitmap(rightSide, final , topSide.Width - rightSide.Width, 0);
final = drawBitmapOnBitmap(bottomSide, final , 0, leftSide.Height - bottomSide.Height);

where draw bitmap effectively does the following:

sourceBitmap.Draw(destinationBitmap, destinationX, destinationY, sourceBitmap.Width, sourceBitmap.Height, Aurigma.GraphicsMill.Transforms.CombineMode.Alpha, 1.0f, Aurigma.GraphicsMill.Transforms.InterpolationMode.LowQuality);[/code]

This works fine except for the fact that on the combined image, the black from the trapezium images shows up AS BLACK. i.e. it covers other parts of images whic it should be letting show through. We were expecting to black to be transparent when combined in this way but it is not - it's solid black. Are we missing something here.. or is the whole approach (i.e. using Combine with Mask and then combining with Draw) wrong to begin with?

Many Thanks in Advance for your help!

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

Dmitry  
#2 Posted : Thursday, February 15, 2007 6:24:34 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,

I have replied to you by email.

Sincerely yours,

Dmitry Sevostyanov

UserPostedImage Follow Aurigma on Twitter!

tneagle99  
#3 Posted : Friday, February 16, 2007 10:12:54 AM(UTC)
tneagle99

Rank: Member

Groups: Member
Joined: 2/15/2007(UTC)
Posts: 18

Many Thanks Dmitry,

Unfortunately, it seems I did not receive your reply email. Would you possibly be able to post what you wrote here?

Many Thanks!

Dmitry  
#4 Posted : Sunday, February 18, 2007 1:08:27 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,

Thanks for your interesting to our software.

Could you submit case with complete sample project which reproduces your problem and we will try to find solution?

Edited by user Thursday, May 22, 2008 9:22:11 PM(UTC)  | Reason: Not specified

Sincerely yours,

Dmitry Sevostyanov

UserPostedImage Follow Aurigma on Twitter!

tneagle99  
#5 Posted : Sunday, February 18, 2007 11:41:43 PM(UTC)
tneagle99

Rank: Member

Groups: Member
Joined: 2/15/2007(UTC)
Posts: 18

Dmitry,

Many thanks in advance for your help with this. I have now sent you an email with a project named 'Box Example' in it for you to take a look at.

Kind Regards,

Tristan

Dmitry  
#6 Posted : Monday, February 19, 2007 5:50:49 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,

Unfortunately we have not received your email. Could you forward copy to [email removed]?

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

Sincerely yours,

Dmitry Sevostyanov

UserPostedImage Follow Aurigma on Twitter!

tneagle99  
#7 Posted : Monday, February 19, 2007 6:13:49 PM(UTC)
tneagle99

Rank: Member

Groups: Member
Joined: 2/15/2007(UTC)
Posts: 18

Dear Dmitry,

Sorry about that - I've now tried resending to your own email address and I sent from two different email addresses in case it was a problem from the sending mail server. Please let me know if you don't receive this within about 30 minutes and I will resend again.

Kind Regards,

Tristan

tneagle99  
#8 Posted : Monday, February 19, 2007 8:03:27 PM(UTC)
tneagle99

Rank: Member

Groups: Member
Joined: 2/15/2007(UTC)
Posts: 18

Hi Dmitry,

Can you please confirm that you got the email I sent with the example project? - I've tried sending a couple of times now to [email removed].

Many Thanks!

Tristan

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

Dmitry  
#9 Posted : Tuesday, February 20, 2007 2:29:44 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,

Thanks, I have received the email. I will reply as soon as possible.

Sincerely yours,

Dmitry Sevostyanov

UserPostedImage Follow Aurigma on Twitter!

tneagle99  
#10 Posted : Wednesday, February 21, 2007 1:05:19 AM(UTC)
tneagle99

Rank: Member

Groups: Member
Joined: 2/15/2007(UTC)
Posts: 18

Dmitry,

Thank you so much for the OUTSTANDING level of support you gave on this. The code changes you suggested have carried out exactly what we needed to be able to do and within the target time. We really couldn't have asked for a better level of support.

I just need to check - to use this on a single-server based website, do we need one single server licence at $349?

Many Thanks!!

Tristan

Dmitry  
#11 Posted : Wednesday, February 21, 2007 4:05:40 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,

Thanks for your answer.

You are right, the cost of Single Server license is $349.0: http://www.aurigma.com/Products...sMilldotNET/default.aspx.

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.