なぜmImage
が表示されないのですか?描画可能でない
public class Manager extends Thread{
private SurfaceHolder mSurfaceHolder;
private boolean mRunning;
public Drawable mImage;
public Manager(SurfaceHolder surfaceHolder, Context context){
mSurfaceHolder = surfaceHolder;
mRunning = false;
Resources res = context.getResources();
mImage = res.getDrawable(R.drawable.nhero2);
public void setRunning(boolean running)
{
mRunning = running;
}
public void run()
{
while (mRunning)
{
Canvas canvas = null;
try
{
// подготовка Canvas-а
canvas = mSurfaceHolder.lockCanvas();
synchronized (mSurfaceHolder)
{
// собственно рисование
//doDraw(canvas);
mImage.draw(canvas);
}
}
catch (Exception e) { }
finally
{
if (canvas != null)
{
mSurfaceHolder.unlockCanvasAndPost(canvas);
}
}
}
}
}
P.S.すみません4私の英語
P.P.S. 私はhttp://pastebin.com/A5u5UJea
この回答を確認してくださいhttp://stackoverflow.com/questions/7740687/add-image-to-surface-view-in-android –
Lalit Poptani、ありがとうございます! – MarkMark