all groups > dotnet drawing api > january 2007 >
You're in the

dotnet drawing api

group:

Antialias Matrix transformation?


Antialias Matrix transformation? Nik Coughlin
1/22/2007 2:30:49 PM
dotnet drawing api:
Does anyone know a way around this? Do I need to write my own transform
code?

It appears that SmoothingMode doesn't apply to matrix transformations (in my
case shear). The following code produces shearing with ugly stepping:

viewPort.Graphics.SmoothingMode = SmoothingMode.AntiAlias;

Matrix m = new Matrix( );
m.Shear( 0, testWall.Shear );
viewPort.Graphics.MultiplyTransform( m );

viewPort.Graphics.DrawImage( testTexture, new Rectangle(
new Point( testWall.Start.X, testWall.Start.Y ),
new Size( newXSize, newYSize ) ) );

Re: Antialias Matrix transformation? Bob Powell [MVP]
1/24/2007 9:21:19 PM
SmoothingMode doesn't affect images. Use InterpolationMode instead.
--
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.





[quoted text, click to view]
Re: Antialias Matrix transformation? Nik Coughlin
1/25/2007 9:47:14 AM
[quoted text, click to view]

You're quite right, unfortunately though InterpolationMode doesn't seem to
affect the shear transform matrix either:

http://nrkn.com/temp/sheared.png

In fact, it looks like that whether I use InterpolationMode or not. Some
edges are aliased, some anti-aliased (Note the bottom edge of the rightmost
wall.

AddThis Social Bookmark Button