DrawView.class中的主要代码 Canvas mCanvas;
   private Bitmap originalBitmap = null;
Bitmap mBitmap;/
private Path mPath;
private Paint mBitmapPaint; // 画布的画笔
Paint mPaint;  // 真实的画笔
private float mX, mY;//临时点坐标
private static final float TOUCH_TOLERANCE = 4; private int screenWidth = 1000, screenHeight = 300;// 屏幕長寬public boolean setBitmap(String imagePath)
{
Bitmap bitmap = BitmapFactory.decodeFile(imagePath);
int width = bitmap.getWidth();
int height = bitmap.getHeight();
float nxScale = -1;
float nyScale = -1;
if( width!=0 && height!=0)
{
nxScale = (float)width/screenWidth;
nyScale = (float)height/screenHeight;
if (nxScale>=1 && nyScale >=1 || nxScale<1 && nyScale<1)
{
if(nxScale > nyScale)
{
width = (int)(width/nxScale);
height = (int)(height/nxScale);
}
else
{
width = (int)(width/nyScale);
height = (int)(height/nyScale);
}

}
if (nxScale >=1 && nyScale <1)
{
width = screenWidth;
}
if(nxScale <=1 && nyScale >=1)
{
height = screenHeight;
}
originalBitmap = Bitmap.createScaledBitmap(bitmap,width,height,true);
mBitmap = Bitmap.createBitmap(width,height,Bitmap.Config.ARGB_8888);
// mSavePath.clear();
//mDeletePath.clear();
mCanvas.setBitmap(mBitmap);
mCanvas.drawBitmap(mBitmap,0,0,mBitmapPaint);
postInvalidate();

return true;
}
else 
return false;
public class TuyaActivity extends Activity{
galler.setOnItemClickListener(new OnItemClickListener() { @Override
public void onItemClick(AdapterView<?> parent, View view,
int position, long id) {
// TODO Auto-generated method stub
String url=ImageList.get(position);
System.out.println(url);
touchView.setBitmap(url);
}
});
}}