Groups | Blog | Home
all groups > dotnet drawing api > march 2007 >

dotnet drawing api : Transformation offset factor


mash
3/29/2007 7:20:00 AM
I'm trying to get my head around working with the Matrix class.

I'm doing something manually that I'd prefer to do with a transformation.
Basically I have shape objects that are responsible for drawing themselves
on a surface. The shapes all store their Positions.
I calculate an offset factor and all shapes should take their x coordinates
and multiply by the offset factor for their new position.
So if a shape's position is (100,50) and my offset factor is 0.5, the new
position should be (50,50).
What I do now is have each shape do this multiplication individually. I'd
rather use a transformation.

How can I apply this offset using some sort of transformation?

Many thanks
mash
3/29/2007 8:18:05 AM
Oh, and I'm working in C#

[quoted text, click to view]
mash
3/29/2007 8:40:01 AM
Hi Bob,

Thanks. I had already downloaded that example and used it to help come up
with the design of my shape objects.
So each of your shapes handles it's own transformations, that will work
great with what I'm doing.

Thanks

[quoted text, click to view]
Bob Powell [MVP]
3/29/2007 5:22:15 PM
See my animation example in Windows Forms Tips and Tricks.

--
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]
Bob Powell [MVP]
3/29/2007 9:51:04 PM
We aims to please ;-)

--
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]
AddThis Social Bookmark Button