aspose file tools*
The moose likes Java Micro Edition and the fly likes Draw Triangle Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "Draw Triangle" Watch "Draw Triangle" New topic
Author

Draw Triangle

Ould Nadif
Ranch Hand

Joined: Jan 21, 2004
Posts: 184
Hi,
The function fillTriangle(int x1, int y1, int x2, int y2, int x3, int y3) is not available in MIDP 1.0.
Could you advice me a way to implement a equivalent function in MIDP.
Thank you in advance.
OULD NADIF


We are ones that build the world, thus build it well.
James Reilly
wrangler
Ranch Hand

Joined: Oct 01, 2003
Posts: 30
Hi,
You can use method drawLine to draw three lines {x1, y1} to {x2, y2},
{x2, y2} to {x3, y3}, and {x3, y3} to {x1, y1}.
jim
Ould Nadif
Ranch Hand

Joined: Jan 21, 2004
Posts: 184
Thanks James for your reply.
It's not a triangle I wanted draw, but a triangle full.
I could've tanks to drawLine:
Example:

for (int i = 0 ; i < SizeBaseTriangle ; i++) {
iX1--;
iY1--;
iX2++;
iY2--;
gc.drawLine(iX1,iY1,iX2, iY2);
}
It works very well.
OULD NADIF
 
Don't get me started about those stupid light bulbs.
 
subject: Draw Triangle
 
Similar Threads
JTAPI /Symbian / call api?
Bluetooth Development
Url encoding in GET request
SSL of J2ME on Palm under KVM
How to separate String from Delimiter?