Re: Transform/Matrix

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Hello Carl,
I took a look at your project and it's vastly overcomplicated for what it
needs to do.

You're trying to rotate the transform for the position and then rotate the
image back again before drawing it. All you really need to do is affect the
position and size of the images as they are drawn.

The best way to do this is to create a simple retained mode graphics system
in which you have objects that know how to draw themselves and that may be
sized or positioned in any way.

The Windows Forms Tips and Tricks article on animation has a good example of
this. Each object may be sized, positioned or rotated independently and
there can be any number of them on the page. The basic graphical object
itself is very simple.

You should create a simple image object that positions the image by it's
centre point and place those center points on the circle described by the
carousel.

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



"cadaha" <carl@xxxxxxxxxxxxx> wrote in message
news:1160100934.956210.175100@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi

I have a small problem that I am trying to overcome.

I have seen Bob's article on Transformations and believe that this is
the right direction to head.

I have a screen with four images of 3 different sizes. top image
smallest, left and right equal size and the bottom image the largest.
I wish to have the center of the group of images (offset to the right
on the form due to the fact that there are navigation buttons on the
left) as the center location of the world grid.

I now have 2 buttons on this part of the screen which are for clockwise
and anticlockwise directional movement. Each click will move all four
images 90 degrees clockwise or anticlockwise in an arc. The images
should stay upright but scale up or down depending upon which slot they
are about to fill.

So in summary 4 images, move 90 degrees in an arc and change size
depending where they will end up.

Easier to do than say propably but as I am a novice at GID+ it is
causing me a headache. Give me a database and data toplay with and I'm
ok LOL. Enjoying learning all this though and hope someone can point
me in the right direction.

Thanks guys

Carl



.


Quantcast