Thank you for visiting the BlackBerry Support Community Forums.
BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)
BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.
"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."
- Kevin Michaluk, Founder, CrackBerry.com
Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.
09-04-2013 04:37 AM
My target is to rotate the line on my angle.
1. I have received two points: A(x1; y1) and B(x2; y2);
2. I have calculated the size of vector AB and the angle of point A:
AB = Math.sqrt(Math.pow((x2 - x1), 2) + Math.pow((y2 - y1), 2));
angleA = 44*
3. I set up the line on the coordinate plane (width = AB, height = 3px):
myLine.layoutProperties.positionX = x1;
myLine.layoutProperties.positionY = y1;
4. I have to rotate the line on the angle which has being found.
The start point of line must be the point A, the end point - point B. But, I failed =(
I try to use the rotationZ, but i dont know how to work with its propertyes PivotX and PivotY.
On default PivotX = 0 and PivotY = 0. When I try to set up PivotX = x1 and PivotY = y1 I get incorrect result.
With PivotX = 0 and PivotY = 0 I get it (myLine.rotationZ = 44):
Please, help me =)
Solved! Go to Solution.
09-04-2013 05:37 AM
P.S.: my line is the image(3px*600px), when I set up it to the coordinate plane the line has the size:
myLine.preferredHeight = 3;
myLine.preferredWidth = AB;
09-11-2013 07:58 PM
That might be happening because setting pivotX and pivotY to zero makes the rotation around the center of the element. In the case of this image that equals to its central point (300, 1.5), but not it's top left point. Try setting the pivotX to -(image.width/2), which will be: -300; and pivotY to -(image.height/2), which is -1.5; and then rotate again.
Please see more details on that topic here: