Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
New Developer
vnlakshmi39
Posts: 46
Registered: ‎12-16-2013
My Device: 9780 Bold
My Carrier: Airtel
Accepted Solution

Rotating image

[ Edited ]

 

As you have told in below link to attach screen shots of my new issues. Please find the below screen shots

Link: http://supportforums.blackberry.com/t5/Java-Development/Image-rotation-with-angle-in-Blackberry/m-p/...

 

Screen shots:

 

screencap_1392877517988.pngscreencap_1392877606349.pngscreencap_1392877786644.pngscreencap_1392877933015.png

 

 

 

 

 

 

Image is rotating based on the angle which am passing. But while rotation image is shrinking means height and width is resizing. Image is not looking nice. Please help me.

Please use plain text.
Developer
peter_strange
Posts: 19,601
Registered: ‎07-14-2008
My Device: Not Specified

Re: Rotating image

[ Edited ]

I thought you had noted my comments: 

 

I said in my last post on yourp previous problem

 

"Be specific in your explanation of the problem and include screen shots and sample code that demonstrates the problem.

 

I also suggest you try to replicate the problem using my sample code above as that it much simpler for others to test. ."

 

So can you do what we ask you to do?  Why should we try to help you if you don't?

 

BTW:  can you also clarify what problem the images show us.  As far as I can see, there only issue is the fuzziness that I would expect from rotating an image like you have. 

 

Finally, I recommend that you do not direct questions to any one person - there are other people on this forum who might help but by directing the question at one person means everyone else will ignore it. 

Please use plain text.
New Developer
vnlakshmi39
Posts: 46
Registered: ‎12-16-2013
My Device: 9780 Bold
My Carrier: Airtel

Re: Rotating image

[ Edited ]

I have used your sample code only but in your sample we have to specify angle and am not getting any issue, its working fine.

I have implemented your code to my magnetometer sample there am getting re-sizing of image and fuzziness. In last screen shot note that image size is smaller compare to other screen shot.

 

For a millisecond this issue will be visible. I am unable to capture it. Sorry am not getting how to explain you

Please use plain text.
Developer
peter_strange
Posts: 19,601
Registered: ‎07-14-2008
My Device: Not Specified

Re: Rotating image

[ Edited ]

What I am not getting is why it works in the code I gave you and does not work in the code you are using.

 

If I was guessing, I would say this is likely some sort of race condition, I suggest that you need to make sure that you do not invoke the image manipulator code until you are sure that it has completed the previous manipulation.  Do not do this using something like synchonization - that is like putting the barrier up on the motorway as I pointed out in your last Thread.  Instead just have a global variable, say

 

long nextCompassDrawTime= 0;

 

then have an if statement in the processing for the direction update along these lines:

 

if ( System.currentTimeMillis() > nextCompassDrawTime ) {

nextCompassDrawTime = nextCompassDrawTime + 1000; // Don't update for 1 second

// code here to transform  the compass image and update the BitmapField

}

 

You will only update the compass once every second with this code, which I appreciate is probably less frequently than you want.  This is just a test.  If it works, then it can be optimised. 

 

This is just a guess, since you have not provided everything requested:

 

"....  sample code that demonstrates the problem"

Please use plain text.
New Developer
vnlakshmi39
Posts: 46
Registered: ‎12-16-2013
My Device: 9780 Bold
My Carrier: Airtel

Re: Rotating image

Thanks you very much I got the solution. Actually I have commented the scaling in ImageManipulator.java. Because of that image is behaving like that.

Please use plain text.
Developer
peter_strange
Posts: 19,601
Registered: ‎07-14-2008
My Device: Not Specified

Re: Rotating image

Please mark this thread as solved. 

Please use plain text.