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 android.app.Activity; import android.os.Bundle; import android.graphics.*; import android.view.*; //import android.graphics.drawable.*; import android.content.*; import android.graphics.Path.*; 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 DocumentRight 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

This note was uploaded on 12/27/2011 for the course IT IITAB3313 taught by Professor Naya during the Spring '11 term at Prince Mohammad Bin Fahd University, Dhahran.

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