currntly doing some project related to the draw lines and path on top of the camera view.
and it require the image have to be ransparency. i did so some reasch on it, and find this "tansparent Panel on google map". and it is can be download.
it said that used Paint.setARGB(a, r, g, b) to set the transparent and color. will, according to the tutorial,
when a = 255, is setted to transparent. however during my test, it is not.
when a =0, even the iamge is black color, it does not shows.
when a = 255, the image is full of color, which i mean the image is not tansparent at all.
and according to my test on my Eclipse IDE with Android V1.5,
the sutible transparent range( to me) is
120<a<200
when a = 120; the image is nearly disappear.
while when a =200, the image is going to be like a picture which is paste on the screen.
below is part of the code i did for testing:
protected void onDraw(Canvas canvas){
super.onDraw(canvas);
float width = getWidth();
float height = getHeight();
rectf.set(0, 0, (width/2), (height/2));
//getWidth() = 320 getHeight()=430 pixl;
trianglePath = new Path();
innerPaint = new Paint();
innerPaint.setARGB(170, 75, 75, 75);
innerPaint.setAntiAlias(true);
boolean clearScreen = this.isClear();
if(clearScreen){
//clear view;
Log.e("xxx","onDraw, clear screen ");
canvas.drawColor(0, PorterDuff.Mode.CLEAR );
}else{
Log.e("xxx","draw arrow");
float[] arrow =this.calculate();
float[] org = {(width/4), height,(width*3/4), height};
trianglePath.moveTo(org[0], org[1]);
trianglePath.lineTo(arrow[4], arrow[5]);
trianglePath.lineTo(arrow[2], arrow[3]);
trianglePath.lineTo(arrow[0], arrow[1]);
trianglePath.lineTo(arrow[8], arrow[9]);
trianglePath.lineTo(arrow[6], arrow[7]);
trianglePath.lineTo(org[2], org[3]);
canvas.drawPath(trianglePath, borderPanit);
canvas.drawPath(trianglePath, innerPaint);
canvas.drawRect(rectf, innerPaint);
//canvas.drawLine((float)org[0], (float)org[1], (float)arrow[0],(float)arrow[1], innerPaint);
}
}