使用mapControl.outputMap方法无法截图 当执行方法mapControl.outputMap(bgBitmap); 报Attempt to invoke virtual method 'int android.graphics.Bitmap.getWidth()' on a null object reference
Bitmap bgBitmap=Bitmap.createBitmap(mapView.getMapControl().getMapWidth(),mapView.getMapControl().getHeight(), Bitmap.Config.ARGB_8888); mapControl.outputMap(bgBitmap);
File file = new File(SDHelper.getSDCardPath() + "test.jpg");
FileOutputStream out = new FileOutputStream(file);
bgBitmap.compress(Bitmap.CompressFormat.JPEG, 100, out);
out.flush();
out.close();