862 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 - Archive

Welcome to the Ask Embedded Wizard archive. This community forum served us well for many years, but we've evolved our support approach!

Your resources:

The Embedded Wizard Online Documentation provides comprehensive documentation, tutorials, examples and ready-to-use software packages.

For dedicated assistance, explore our Embedded Wizard Product Support.

You can still browse the valuable discussions from our community history here.

Embedded Wizard Website | Privacy Policy | Imprint

...