기술/beginning games2011. 5. 25. 11:56
download download
public class BitmapTest extends Activity {
class RenderView extends View {
Bitmap aosi;
Bitmap corea;
Rect dst = new Rect();
public RenderView(Context context) {
super(context);
try{
AssetManager assetManager = context.getAssets();
InputStream is = assetManager.open("christmas.png");
aosi = BitmapFactory.decodeStream(is);
is.close();
Log.d("Aosi Test=","christmas.png 형식 : "+aosi.getConfig());
is = assetManager.open("widget.png");
BitmapFactory.Options options = new BitmapFactory.Options();
corea = BitmapFactory.decodeStream(is,null,options);
is.close();
Log.d("Aosi Test=","widget.png 형식 : "+corea.getConfig());
} catch(IOException e){
} finally {
}
}
protected void onDraw(Canvas c){
dst.set(50,50,350,350);
c.drawBitmap(aosi, null, dst,null);
c.drawBitmap(corea, 100, 100,null);
invalidate();
}
}
@Override
public void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   requestWindowFeature(Window.FEATURE_NO_TITLE);
   getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
   setContentView(new RenderView(this));
}

}
download download download
Posted by yachtie_leo