327 views
in GUI Development by

Hello!

I have some troubles trying to rotate WarpImage object.

I try to rotate the image on 1 degree steps, but it rotates only once at 90 degrees and stops any further rotations.

I use timer to increment angle value by 1 degree per second and to test rotation - angle is a global variable.

Here is my code:

sender; /* the method is called from the sender object */

var point destPos = Bounds.orect.center;

if(angle<-90)
  angle--;
else
  angle=0;

  var float scale=1.0;

maskBLImg.RotateAndScale( destPos, angle, scale, scale );

Would you please help!

Thank you!

1 Answer

0 votes
by

Hello,

according to your description you increment angle every second.

However, your code is setting it always to 0:

if(angle<-90)
  angle--;
else
  angle=0;

Is this the problem? You can add a simple

trace angle;

statement before the RotateAndScale() method to verify the current angle value.

Best regards,

Manfred.

by
Yes this is definitely a mistake and angle always will be 0.

But when I try some direct value for example 15 degrees image again rotates at 90 degrees?!
by

Have you seen the installed examples "AviationDemo" or "Watches"? 

Each of them shows instruments or clocks with a needle that is rotated by using the method RotateAndScale(). Please investigate these examples and check for differences compared to your example.

If you still have no success, please upload your example here.

Best regards,

Manfred.

by
OK, Manfred!

I will check these examples.

I hope the problem will solve!

Thank you!

Ask Embedded Wizard

Welcome to the question and answer site for Embedded Wizard users and UI developers.

Ask your question and receive answers from the Embedded Wizard support team or from other members of the community!

Embedded Wizard Website | Privacy Policy | Imprint

...