HighTechTalks DotNet Forums  

Transformation offset factor

Dotnet Framework (Drawing) microsoft.public.dotnet.framework.drawing


Discuss Transformation offset factor in the Dotnet Framework (Drawing) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
mash
 
Posts: n/a

Default Transformation offset factor - 03-29-2007 , 10:20 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


Reply With Quote
  #2  
Old   
mash
 
Posts: n/a

Default RE: Transformation offset factor - 03-29-2007 , 11:18 AM






Oh, and I'm working in C#

"mash" wrote:

Quote:
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


Reply With Quote
  #3  
Old   
Bob Powell [MVP]
 
Posts: n/a

Default Re: Transformation offset factor - 03-29-2007 , 11:22 AM



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.





mash wrote:
Quote:
Oh, and I'm working in C#

"mash" wrote:

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


Reply With Quote
  #4  
Old   
mash
 
Posts: n/a

Default Re: Transformation offset factor - 03-29-2007 , 11:40 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

"Bob Powell [MVP]" wrote:

Quote:
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.





mash wrote:
Oh, and I'm working in C#

"mash" wrote:

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



Reply With Quote
  #5  
Old   
Bob Powell [MVP]
 
Posts: n/a

Default Re: Transformation offset factor - 03-29-2007 , 03:51 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.





mash wrote:
Quote:
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

"Bob Powell [MVP]" wrote:

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.





mash wrote:
Oh, and I'm working in C#

"mash" wrote:

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


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.