changing color of the circle - canvas.drawPath(circle1...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
package org.example.sudo; import; import android.os.Bundle; import*; import android.view.*; //import*; import android.content.*; import*; import android.util.*; import android.content.Intent; import android.view.View; import android.view.View.OnClickListener; public class Logo extends Activity implements OnClickListener{ static public Canvas canvasPub; Paint paint11 = new Paint(); public Logo(){ super(); } public class GraphicsView extends View{ public GraphicsView(Context context) { super(context); } @Override protected void onDraw(Canvas canvas){ canvasPub = canvas; Path circle1 = new Path(); circle1.addCircle(150, 150, 100, Direction.CW); Paint paint1 = new Paint(); paint1.setColor(0xa000ff00); Paint paint2 = new Paint(); paint2.setColor(Color.BLUE);
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: canvas.drawPath(circle1, paint1); canvas.drawTextOnPath("Human Computer Interaction", circle1, 400, 20, paint2); Path circle = new Path(); circle.addCircle(200, 200, 100, Direction.CW); canvas.drawPath(circle, paint11); } } static public GraphicsView viewPub; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); paint11.setColor(0xffffffff); viewPub = new GraphicsView(this); setContentView(viewPub); viewPub.setOnClickListener(this); } public void onClick (View v) { int color = paint11.getColor()-0x00202020; paint11.setColor(color); setContentView(v); } } canvas.drawTextOnPath( " ةهماج ريمل± د²حم نب دهف " , circle1, 400, 20, paint2);...
View Full Document

{[ snackBarMessage ]}

Page1 / 2

changing color of the circle - canvas.drawPath(circle1...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online