aspose file tools*
The moose likes Java Micro Edition and the fly likes Creating a red color ring in canvas Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "Creating a red color ring in canvas" Watch "Creating a red color ring in canvas" New topic
Author

Creating a red color ring in canvas

Michael
Greenhorn

Joined: Jan 31, 2005
Posts: 4
How to create a red colour ring in the canvas.Please reply me.I want the codes.Please Take this as a request.

Thanks in advance
Svend Rost
Ranch Hand

Joined: Oct 23, 2002
Posts: 904
Welcome to the JavaRanch. You ought to take a look at: The Naming Convention

Please reply me.I want the codes

Umm...
Take this as a request

Ok. Done.

Anyways, onto your request. What kind of ring to you want? An image, or
just a drawn circle? Please me more specific.

For information about the Graphics class in J2ME, take a look at: http://www.kickjava.com/3204.htm


/Svend Rost
Michael
Greenhorn

Joined: Jan 31, 2005
Posts: 4
thanks for replying me.I want a red colour ring not an image.
Its is like white coloured small circle inside an big red circle and background of the canvas is white.So it looks like a red coloured ring.
Jeff Jetton
Ranch Hand

Joined: Mar 29, 2005
Posts: 71
Ah, well, it sounds like you're on the right track, conceptually. What have you got so far? Does your app create the canvas okay? Can you have it draw anything on the canvas?

Assuming that you've gotten that far, the next steps are:

1) Set the drawing color to red. Use the setColor() method of the Graphics class for this.

2) Draw your large circle whereever you want. Use fillArc() method of the Graphics class for this.

3) Set the color to white.

4) Draw your small circle. You'll probably need to experiment a bit with different x/y offset values to get it to look the way you want.

- Jeff
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

"Michael"-
Welcome to the JavaRanch! Please adjust your displayed name to meet the

JavaRanch Naming Policy.

You can change it

here.

Thanks! and welcome to the JavaRanch!

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Michael
Greenhorn

Joined: Jan 31, 2005
Posts: 4
I got the following codes for big red circle.
{
g.setColor(0xFFFFFF);

g.fillRect(0,0,getWidth(),getHeight());
int diameter=getWidth()/2;
g.setColor(color);
g.fillArc(diameter/2,diameter/2,diameter,diameter,0,360);
g.setColor(0x000000);
g.drawString(getNameFromProfile(),getWidth()/2,getWidth()/2,Graphics.HCENTER|Graphics.TOP);
}

I want the parameters for g.fillArc of the new small white circle.I tried different parameters.But i didn't got it correct.Can u plz try for me.
Thanks.
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

Michael, please read my previous post and change your display name.

Mark
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Creating a red color ring in canvas
 
Similar Threads
What color is fun?
WA #1.....word association
T cannot be resolved to a type
Visual puzzle
WA #2 ..... word association