Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8240249
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T20:25:31+00:00 2026-06-07T20:25:31+00:00

Could someone explain me why code below which is called from Paint event doesn’t

  • 0

Could someone explain me why code below which is called from Paint event doesn’t draw 7 blades (NumberOfBlades = 7 in this case). For other blade numbers (3-7) it also misses blades for some angles, only for 4 blades it does works. I’m almost sure that it is some kind of small & stupid mistake but i just can’t figure it out.

Matrix transformMatrix = new Matrix();
PointF center = new PointF(x2, y);

float angle = 360.0f / (float)pump.Calculations.NumberOfBlades;

for (int i = 0; i < pump.Calculations.NumberOfBlades; i++)
{
    transformMatrix.Reset();
    transformMatrix.RotateAt(angle * i, center);
    blade.Transform(transformMatrix);
    g.DrawPath(blackPen, blade);
}

Example

Edit

I’ve found solution:

for (int i = 0; i < pump.Calculations.NumberOfBlades; i++)
{        
    transformMatrix.RotateAt(angle, center,MatrixOrder.Prepend);
    g.Transform = transformMatrix;
    //lopatka.Transform(transformMatrix);
    g.DrawPath(blackPen, blade);
    g.ResetTransform();
}

So now my question is why it works this way?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T20:25:33+00:00Added an answer on June 7, 2026 at 8:25 pm

    It looks like you’re accumulating increasing rotations in your blade GraphicsPath (since you’re not resetting blade to the start position each iteration). Either Rotate incrementally, or reset blade to the start position.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Could someone please explain function(tx) in the code snippet below, from this page: http://www.webkit.org/demos/sticky-notes/
Could someone explain me, why I get 12 Februray when running the code below?
I get a java.lang.ClassNotFoundException , when I execute the below code. Could someone explain
Could someone explain to me what this portion of code means? repeat scroll 0
I'm rather new to these could someone explain the significance (of the following code)
Could someone please explain the difference between the following two lines of code: 1.
Could someone please explain the difference in how the 2 snippets of code are
Below is the snippet of code that keeps giving me the problem. Could someone
Can someone explain me the working of a malloc wrapper for below code?? RTLD_NEXT
Could someone explain what this code does size = *(int *)data; // size of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.