摘要:
背景: 使用SurfaceView通过标准的Canvas方法直接操作图像像素进行绘图, View的大小不固定是可以改变的(这里假设View的宽度为ViewWidth,View的高度为ViewHeight)。需要显示的图像的大小也不确定(这里假设图像的宽度为ImageWidth,图像的高度为ImageHeight)。问题:如何自适应的在每次绘制时图像正好画到View的正中央。这里绘制图像用到的是标准的Canvas的方法:Public voiddrawBitmap(int[] colors, int offset, int stride, float x, float y, int width, 阅读全文
posted @ 2011-11-22 17:57 StarSoul 阅读(314) 评论(0) 推荐(0)