BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 02-11-2008, 12:57 PM   #1 (permalink)
New Member
 
Join Date: Feb 2008
Model: 8300
PIN: N/A
Carrier: N/A
Posts: 2
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Drawing arrows

Please Login to Remove!

I couldn't find a method to draw an arrow , I was thinking of loading a bitmap of an arrow , but will I be able to rotate the bitmap ?

Thanks.
Offline  
Old 02-12-2008, 03:19 AM   #2 (permalink)
CrackBerry Addict
 
Join Date: Apr 2005
Location: hamburg, germany
Model: 8900
Carrier: o2
Posts: 838
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

you can use graphics to draw whatever you want. not as easy as using paint, though
i don't think there is api support for rotating bitmaps, at least i don't know of any. you could add more then one image, though.
__________________
java developer, Devinto, hamburg/germany
Offline  
Old 02-12-2008, 05:28 PM   #3 (permalink)
Knows Where the Search Button Is
 
Join Date: Jul 2007
Model: 8300
PIN: N/A
Carrier: AT&T
Posts: 25
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by alhazen View Post
I couldn't find a method to draw an arrow , I was thinking of loading a bitmap of an arrow , but will I be able to rotate the bitmap ?

Thanks.
I think the straight forward way is to draw a bitmap for the arrow. I did it once when I had to draw right and left arrows. There is no API to rotate a bitmap, but you can add code to do that. It is not hard. The simplest algorithm is to go over the bitmap, byte by byte and change their positions depending on the rotation. The algorithm uses the sin and cos functions if the rotation is any arbitrary angle. What I have noticed is that the algorithm is slow if you have big bitmaps, but it is acceptable for small bitmaps.

rab
Offline  
Old 02-13-2008, 04:09 PM   #4 (permalink)
New Member
 
Join Date: Feb 2008
Model: 8300
PIN: N/A
Carrier: N/A
Posts: 2
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for your replies. Actually , my program that requires the arrow is simple , and I don't want to over complicate things. I was thinking of implementing it with a line and arc or a rectangle and a triangle composite. I'm a newbie , can you please guide me to drawing composite figures given the fact that there are other field on the main screen.

Thanks.
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Copyright 2004-2014 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.