Re: Make edges smooth after cliping.
- From: "Bob Powell [MVP]" <bob@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sun, 31 Dec 2006 16:09:22 +0100
Clipping and drawing are two different principles.
Drawing that uses antialiasing attempts to hide the alias effects of the basic pixel resolution of the output device by drawing on pixels that are outside of the shape and creating an average colour containing a mix of the origianal and new colours. The result is that the result appears to be better but is in fact not a true representation.
Clipping on the other hand, is a mechanical process of including or excluding pixels from a certain area. The clip boundary falls on the pixel boundaries and so the pixel cannot be antialiased.
Try filling a path with a brush created from the image.
--
Bob Powell [MVP]
Visual C#, System.Drawing
Ramuseco Limited .NET consulting
http://www.ramuseco.com
Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm
Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm
All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
danila.benhur@xxxxxxxxx wrote:
Greeting!.
I'm using the following code.
// Create graphics path represented by rectangle with rounded angles
GraphicsPath roundedRectangle = this.GetRoundedRectPath(rect, 13);
g.PixelOffsetMode = PixelOffsetMode.HighQuality;
g.SmoothingMode = SmoothingMode.HighQuality;
// Set clipping region
g.Clip = new Region(roundedRectangle);
// Draw loaded previously image
g.DrawImage(bmp, 10, 10);
After this code execution i get clipped image. It is clipped with
rectangle with rounded angles. But i have a problem: edges of the
clipped image is rough. Is there any possibility to make the edges of
clipped image smooth?
I really appreciate Your help and thanks in advance.
- Prev by Date: Re: call two page crystalreports in VB
- Next by Date: Rounded rectangle and resize
- Previous by thread: Re: call two page crystalreports in VB
- Next by thread: Re: Make edges smooth after cliping.
- Index(es):
Relevant Pages
|