I tried this:
g.RotateTransform(degrees);
But nothing happens. I have one graphic object and one object with a rectangle created using this method:
g.FillRectangle(new TextureBrush(Image.FromFile(@"D:\LOVE&LUA\Pictures\yellowWool.png")), rectangle);
And I need to somehow rotate the rectangle and draw it again.
Answer the sample code, please, and with a simple explanation.
EDIT: Here is the actual code I'm using:
public void Draw(Graphics g,PointF location,Color clearColor) { rectangle.Location = location; g.Clear(clearColor); g.RotateTransform(10);
Every frame I call this function, and I use the Paint e.Graphics form object for Graphics, and I have a timer witch only calls this.Refresh();
EDIT 2: OK I played a little with transformations, and g.RotateTransform rotates the entire core system of the graphycs object, and I need to rotate only the rectangle without changing the core system
Bosak source share