@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_work_mapping_activity); // Intent recieve = getIntent(); buildingImg = recieve.getByteArrayExtra("img"); z = recieve.getDoubleExtra("z", 0); scale = recieve.getDoubleExtra("scale", 0.05); savedPoint = new xy(); curPoint = new xy(); // getWindowSize(); drawer = (SlidingDrawer) findViewById(R.id.activity_work_mapping_drawer); menulayer = (LinearLayout) findViewById(R.id.activity_work_mapping_draggable_containmenubuttonlayout); map_frame = (FrameLayout) findViewById(R.id.activity_work_mapping_draggable_frame); DimageView = (DraggableImageView) findViewById(R.id.activity_work_mapping_draggable_imageview); // BitmapFactory.Options option = new BitmapFactory.Options(); option.inScaled = false; // Bitmap backgroudImage = getMapBitmap(option); createOverlayView(backgroudImage.getWidth(), backgroudImage.getHeight(), backgroudImage); setImageHandler(); DimageView.setHandler(handler); DimageView.setDmetric(getDispaymetric()); DimageView.setImageBitmap(backgroudImage); arr_button_menu = new Button[8]; measureCheckBox = (CheckBox) findViewById(R.id.activity_work_mapping_drawer_check_measure); measureCheckBox.setOnCheckedChangeListener(checkboxListener); measureCheckBox.setTag(1); measureCheckBox.setChecked(true); poiCheckBox = (CheckBox) findViewById(R.id.activity_work_mapping_drawer_check_poi); poiCheckBox.setOnCheckedChangeListener(checkboxListener); poiCheckBox.setTag(2); poiCheckBox.setChecked(true); wayCheckBox = (CheckBox) findViewById(R.id.activity_work_mapping_drawer_check_way); wayCheckBox.setOnCheckedChangeListener(checkboxListener); wayCheckBox.setTag(3); wayCheckBox.setChecked(true); UpdateButton = (Button) findViewById(R.id.activity_work_mapping_drawer_button_update); UpdateButton.setOnClickListener(l); createPOIInputDialog(); createMeasureDialog(); setInputHandler(); init(); }
public void createOverlayView(int w, int h, Bitmap backgroudImage) { overlay = new ImageView[4]; Bitmap bit = Bitmap.createBitmap(1024, 1024, Bitmap.Config.ARGB_8888); overlay[0] = new GridOverlayView(this); overlay[1] = new MeasurePointOverlayView(this); overlay[2] = new POIOverlayView(this); overlay[3] = new WayPointOverlayView(this); for (int i = 0; i < 4; i++) { overlay[i].setLayoutParams(DimageView.getLayoutParams()); overlay[i].setBackgroundColor(Color.TRANSPARENT); overlay[i].setScaleType(ScaleType.MATRIX); overlay[i].setImageBitmap(bit); map_frame.addView(overlay[i]); } }