package com.chaoran.entiry;

import com.example.chaoran.MainActivity;
import com.util.DialogUtil;
import com.util.SysUtil;

import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Rect;
import android.view.Gravity;
import android.view.View;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.LinearLayout;

public class PhotographUi extends LinearLayout {
	private SelfImage image;
	private Button pz;

	public PhotographUi(Context context, int h) {
		super(context);
		this.setOrientation(VERTICAL);
		setGravity(Gravity.CENTER_VERTICAL);
		this.setVerticalGravity(1);
		image = new SelfImage(context,true);
		addView(image, new LayoutParams(LayoutParams.MATCH_PARENT,
				h));
		pz = new Button(context);
		pz.setText("拍照");
		addView(pz, new LayoutParams(LayoutParams.MATCH_PARENT,
				LayoutParams.WRAP_CONTENT));
	}
	public void setOnClickListener(OnClickListener clickListener){
		pz.setOnClickListener(clickListener);
	}
	public void setImageOnClickListener(OnClickListener clickListener){
		image.setOnClickListener(clickListener);
	}
	public void setImageBitmap(Bitmap bitmap){
	    image.setBitmap(bitmap);
	}
	public Bitmap getImageBitmap(){
		return image.getBitmap();
	}
}
