How to move a circle from one place to another??

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

How to move a circle from one place to another??

Postby ArunThakkar » Mon Mar 02, 2009 11:07 am

Hi friends,
Hope you all are fine, and have in best of your moods...

I have a problem with moving circle from one place to another.
If anyone from you guys know, kindly write for it.

Thanx in Advance...
Thank You,
Arun Thakkar.
ArunThakkar
Freshman
Freshman
 
Posts: 5
Joined: Mon Feb 23, 2009 1:52 pm
Location: Ahmedabad, India

Top

Postby MrSnowflake » Mon Mar 02, 2009 11:10 am

You might wanna elaborate on your problem, as from "moving a circle" it's not clear what you want.
User avatar
MrSnowflake
Moderator
Moderator
 
Posts: 1439
Joined: Sat Feb 16, 2008 3:11 pm
Location: Flanders, Belgium

Postby ArunThakkar » Mon Mar 02, 2009 12:56 pm

Ok, I now go through details.

I have draw a circle at one point say (50,100) with radios = 20;
now i want to move this circle to a point say (200,200).

What to do for that.

I have copied my .java file below, kindly refer it.


import android.app.Activity;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Rect;
import android.os.Bundle;
import android.view.View;

public class Drawline extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

setContentView(new SampleView(this));

}

private static class SampleView extends View
{
public SampleView(Context context)
{
super(context);

}

protected void onDraw(Canvas canvas)
{


Paint p = new Paint();
// p.setStyle(Paint.Style.FILL);

p.setColor(Color.BLUE);
p.setStyle(Paint.Style.STROKE);

canvas.drawColor(Color.WHITE);

canvas.drawCircle(50, 100, 20, p);


}
}


}
Thank You,
Arun Thakkar.
ArunThakkar
Freshman
Freshman
 
Posts: 5
Joined: Mon Feb 23, 2009 1:52 pm
Location: Ahmedabad, India

Postby MrSnowflake » Mon Mar 02, 2009 2:52 pm

I'm sorry, but if you have to ask help for such a simple thing, either, you should 1-up your programming skills, or search for other examples as there are thousands on the web. I've made a tutorial for 2D graphics, you could have found if you searched the board first.
User avatar
MrSnowflake
Moderator
Moderator
 
Posts: 1439
Joined: Sat Feb 16, 2008 3:11 pm
Location: Flanders, Belgium

Postby DrDresch » Fri Mar 13, 2009 12:43 am

User avatar
DrDresch
Once Poster
Once Poster
 
Posts: 1
Joined: Fri Mar 13, 2009 12:38 am

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 9 guests