BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 02-11-2008, 01:57 PM   #1
alhazen
New Member
 
Join Date: Feb 2008
Model: 8300
PIN: N/A
Carrier: N/A
Posts: 2
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, 04:19 AM   #2
simon.hain
CrackBerry Addict
 
Join Date: Apr 2005
Location: hamburg, germany
Model: 8900
Carrier: o2
Posts: 838
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, 06:28 PM   #3
rab1
Knows Where the Search Button Is
 
Join Date: Jul 2007
Model: 8300
PIN: N/A
Carrier: AT&T
Posts: 25
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, 05:09 PM   #4
alhazen
New Member
 
Join Date: Feb 2008
Model: 8300
PIN: N/A
Carrier: N/A
Posts: 2
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


New In Box Schneider TSXMRPC001M Memory Card Module picture

New In Box Schneider TSXMRPC001M Memory Card Module

$519.99



Coltene Hyflex CM Controlled Memory NiTi Files Rotary File System Set of 6 Files picture

Coltene Hyflex CM Controlled Memory NiTi Files Rotary File System Set of 6 Files

$42.74



New In Box Schneider TSXMRPP224K Memory Module picture

New In Box Schneider TSXMRPP224K Memory Module

$338.48



AB 1747M13 SER A SLC EEPROM Memory Module 1747-M13 NEW IN BOX picture

AB 1747M13 SER A SLC EEPROM Memory Module 1747-M13 NEW IN BOX

$71.24



1PC Micron 8GB PC4-2400T DDR4 Memory MTA18ASF1G72HZ-2G3B1ZG Laptop RAM -  NEW picture

1PC Micron 8GB PC4-2400T DDR4 Memory MTA18ASF1G72HZ-2G3B1ZG Laptop RAM - NEW

$159.00



Dental Endo NiTi Gold Taper Heat Activated /Rotary Files Engine Use 21mm/25mm picture

Dental Endo NiTi Gold Taper Heat Activated /Rotary Files Engine Use 21mm/25mm

$234.68







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