Created
January 29, 2014 05:54
-
-
Save jab416171/8682613 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class DrawingPanel extends SurfaceView implements SurfaceHolder.Callback { | |
private final Drawable mCustomImage; | |
@Override | |
public void onDraw(Canvas canvas) { | |
super.onDraw(canvas); | |
mCustomImage.setBounds(new Rect(0, 0, 50, 50)); | |
mCustomImage.draw(canvas); | |
} | |
private PanelThread _thread; | |
public DrawingPanel(Context context) { | |
this(context, null); | |
} | |
public DrawingPanel(Context context, AttributeSet attrs) { | |
this(context, attrs, 0); | |
} | |
public DrawingPanel(Context context, AttributeSet attrs, int defStyle) { | |
super(context, attrs, defStyle); | |
mCustomImage = context.getResources().getDrawable(R.drawable.ic_launcher); | |
getHolder().addCallback(this); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment