修改图片分辨率

This commit is contained in:
wangdongsheng
2021-08-31 16:39:50 +08:00
parent add1d841fe
commit e4d6924c9e
4 changed files with 22 additions and 42 deletions

View File

@@ -288,7 +288,7 @@ public class MainActivity extends BaseActivity {
FileOutputStream fileOutputStream = null; FileOutputStream fileOutputStream = null;
if (is != null) { if (is != null) {
//对apk进行保存 //对apk进行保存
File file = new File(Constant.NABISCO_APk +"DTXB.apk"); File file = new File(Constant.NABISCO_APk +"NVINFO.apk");
fileOutputStream = new FileOutputStream(file); fileOutputStream = new FileOutputStream(file);
byte[] buf = new byte[1024]; byte[] buf = new byte[1024];
int ch; int ch;

View File

@@ -398,6 +398,7 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
initMapShort(); initMapShort();
} }
} }
//小图 //小图
private void initMapBig() { private void initMapBig() {
isMapSlide = false; isMapSlide = false;
@@ -408,6 +409,7 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
setLocMarkerStyle(LOCATION_TYPE_LOCATION_ROTATE); setLocMarkerStyle(LOCATION_TYPE_LOCATION_ROTATE);
cbMapType.setChecked(false); cbMapType.setChecked(false);
} }
//大图 //大图
private void initMapShort() { private void initMapShort() {
isMapSlide = true; isMapSlide = true;
@@ -500,4 +502,5 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
removables.add(marker); removables.add(marker);
FileUtils.writeFile(paperFile.getAbsolutePath(), sb.toString(), true); FileUtils.writeFile(paperFile.getAbsolutePath(), sb.toString(), true);
} }
} }

View File

@@ -89,7 +89,6 @@ public class TestActivity extends BaseActivity {
removables = new ArrayList<>();//存储网络数据的marker数据线 removables = new ArrayList<>();//存储网络数据的marker数据线
markerLatlng = new ArrayList<>();//存储网络数据的marker数据线 markerLatlng = new ArrayList<>();//存储网络数据的marker数据线
initList(Constant.currentLocation); initList(Constant.currentLocation);
initNewMarker();
} }
@@ -212,7 +211,6 @@ public class TestActivity extends BaseActivity {
} }
markerLatlng.add(latLng); markerLatlng.add(latLng);
switch (list.get(i).getType()) { switch (list.get(i).getType()) {
case 1://poi case 1://poi
BitmapDescriptor poiDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi_bg1); BitmapDescriptor poiDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi_bg1);
//poiDescriptor.getForager().setScale(50); //poiDescriptor.getForager().setScale(50);
@@ -237,7 +235,6 @@ public class TestActivity extends BaseActivity {
stationMarker.setTag(listBean); stationMarker.setTag(listBean);
removables.add(stationMarker); removables.add(stationMarker);
stationMarker.setClickable(true); stationMarker.setClickable(true);
break; break;
case 3://poi录像 case 3://poi录像
BitmapDescriptor poiVideoDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi_video_bg1); BitmapDescriptor poiVideoDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi_video_bg1);
@@ -262,7 +259,6 @@ public class TestActivity extends BaseActivity {
roadMarker.setTag(listBean); roadMarker.setTag(listBean);
removables.add(roadMarker); removables.add(roadMarker);
roadMarker.setClickable(true); roadMarker.setClickable(true);
break; break;
case 5://其他 case 5://其他
BitmapDescriptor otherDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_other_bg1); BitmapDescriptor otherDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_other_bg1);
@@ -291,6 +287,7 @@ public class TestActivity extends BaseActivity {
} }
} }
} }
initNewMarker();
Message obtain = Message.obtain(); Message obtain = Message.obtain();
obtain.what = Constant.JOB_SEARCH_WORD; obtain.what = Constant.JOB_SEARCH_WORD;
obtain.obj = response; obtain.obj = response;
@@ -298,9 +295,7 @@ public class TestActivity extends BaseActivity {
} else { } else {
Toast.makeText(TestActivity.this, response.getMessage(), Toast.LENGTH_SHORT).show(); Toast.makeText(TestActivity.this, response.getMessage(), Toast.LENGTH_SHORT).show();
} }
} }
@Override @Override
public void onError(Throwable e, int id) { public void onError(Throwable e, int id) {
dismissLoadingDialog(); dismissLoadingDialog();
@@ -313,9 +308,7 @@ public class TestActivity extends BaseActivity {
protected void initView() { protected void initView() {
super.initView(); super.initView();
TextureMapView tvMap = findViewById(R.id.iv_map); TextureMapView tvMap = findViewById(R.id.iv_map);
tencentMap = tvMap.getMap(); tencentMap = tvMap.getMap();
//获取地图UI 设置对象 //获取地图UI 设置对象
UiSettings uiSettings = tencentMap.getUiSettings(); UiSettings uiSettings = tencentMap.getUiSettings();
//设置logo的大小 //设置logo的大小
@@ -325,33 +318,21 @@ public class TestActivity extends BaseActivity {
//uiSettings.setAllGesturesEnabled(false); //uiSettings.setAllGesturesEnabled(false);
setLocMarkerStyle(LOCATION_TYPE_LOCATION_ROTATE_NO_CENTER); setLocMarkerStyle(LOCATION_TYPE_LOCATION_ROTATE_NO_CENTER);
// initCluster(); // initCluster();
} }
private void initNewMarker() { private void initNewMarker() {
//添加圆 //添加圆
LatLng mapCenterPoint = tencentMap.getCameraPosition().target; LatLng mapCenterPoint = tencentMap.getCameraPosition().target;
circle = tencentMap.addCircle(new CircleOptions(). circle = tencentMap.addCircle(new CircleOptions().
// 圆心 center(mapCenterPoint).// 圆心
center(mapCenterPoint). radius(1000d).// 半径
// 半径 fillColor(0xff0000ff).// 圆的填充色为蓝色
radius(1000d). strokeColor(0xff000000).// 描边的颜色为黑色
// 圆的填充色为蓝色 strokeWidth(1).// 描边宽度
fillColor(0xff0000ff). clickable(true).// 可点击性
// 描边的颜色为黑色 visible(true).// 可见性
strokeColor(0xff000000). zIndex(2));// 层级
// 描边宽度 circle.setFillColor(0xFF00ff00);// 设置圆的填充色为红色
strokeWidth(1).
// 可点击性
clickable(true).
// 可见性
visible(true).
// 层级
zIndex(2));
// 设置圆的填充色为红色
circle.setFillColor(0xFF00ff00);
// 移除圆 // 移除圆
// circle.remove(); // circle.remove();
//中心点的圆 //中心点的圆
@@ -361,14 +342,9 @@ public class TestActivity extends BaseActivity {
// 点与多点直接形成的交叉点 // 点与多点直接形成的交叉点
if (multiPoint!=null){ if (multiPoint!=null){
Geometry intersection = geometry.intersection(multiPoint); Geometry intersection = geometry.intersection(multiPoint);
// if (intersection.getGeometryType().equals("Point")){}
String geometryType = intersection.getGeometryType(); Log.d("ddddd", "initNewMarker: " + intersection);
//
Log.d("ddddd", "initNewMarker: " + geometryType);
} }
} }
private void initCluster() { private void initCluster() {
@@ -441,7 +417,6 @@ public class TestActivity extends BaseActivity {
private void setLocMarkerStyle(int style) { private void setLocMarkerStyle(int style) {
tencentMap.setLocationSource(new MyTecentLocationSource(this)); tencentMap.setLocationSource(new MyTecentLocationSource(this));
tencentMap.setMyLocationEnabled(true); tencentMap.setMyLocationEnabled(true);
MyLocationStyle locationStyle = new MyLocationStyle(); MyLocationStyle locationStyle = new MyLocationStyle();
locationStyle = locationStyle.myLocationType(style); locationStyle = locationStyle.myLocationType(style);
//创建图标 //创建图标
@@ -480,8 +455,6 @@ public class TestActivity extends BaseActivity {
0, //目标倾斜角 0, //目标倾斜角
tencentLocation.getBearing())); //目标旋转角 0~360° (正北方为0) tencentLocation.getBearing())); //目标旋转角 0~360° (正北方为0)
tencentMap.animateCamera(cameraSigma); tencentMap.animateCamera(cameraSigma);
} }
} }
} }

View File

@@ -16,8 +16,12 @@
android:id="@+id/camera" android:id="@+id/camera"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
app:cameraPictureSizeMaxArea="1200000" app:cameraPictureSizeMaxArea="1000000"
app:cameraPictureSizeMaxWidth="1080" app:cameraPictureSizeMinArea="600000"
app:cameraPictureSizeMaxWidth="960"
app:cameraPictureSizeMinHeight="720"
app:cameraPictureSizeMinWidth="720"
app:cameraPictureSizeMaxHeight="960"
android:keepScreenOn="true" android:keepScreenOn="true"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />