我有一个记号笔,本质上是一个缩略图。所以我想知道的是,是否可以点击缩略图并显示更大的缩略图,类似于放大或放大缩略图?很抱歉问了这么短的问题。目前我没有任何代码,但是如果有人可以帮助我,我会在我们进行的时候发布代码。
摄像机意图:
Intent getCameraImage = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
getApplicationContext().getDir(
getResources().getString(R.string.app_name), MODE_PRIVATE);
fileUri = Uri.fromFile(new File((Environment.getExternalStorageDirectory() +
"/" +getResources().getString(R.string.app_name)),new Date().getTime() + ".jpg"));
getCameraImage.putExtra(MediaStore.EXTRA_OUTPUT, fileUri);
startActivityForResult(getCameraImage, TAKE_PICTURE);
} onActivityResult
try {
GetImageThumbnail getImageThumbnail = new GetImageThumbnail();
bitmap = getImageThumbnail.getThumbnail(fileUri, this);
} catch (FileNotFoundException e1) {
e1.printStackTrace();
} catch (IOException e1) {
e1.printStackTrace();
}
{
MarkerOptions markerOptions = new MarkerOptions()
.position(theLastPlaceThatTheUserLongClicked)
.icon(BitmapDescriptorFactory
.fromBitmap(bitmap));
googleMap.addMarker(markerOptions);
}
}
}showFullImage
public void showFullImage(View view) {
String path = (String) view.getTag();
if (path != null) {
Intent intent = new Intent();
intent.setAction(Intent.ACTION_VIEW);
Uri imgUri = Uri.parse("file://" + path);
intent.setDataAndType(imgUri, "image/*");
startActivity(intent);
}
}
}那么,如何在onMarkerClick中实现showFullImage呢?
onMarkerClick
@Override
public boolean onMarkerClick(final Marker marker) {
return false;
}发布于 2014-12-16 16:57:23
你能做的是
myMarker= map
.addMarker(new MarkerOptions()
.position(pos)
.title(getResources().getString(R.string.reachUs))
.snippet("We are here")
.icon(BitmapDescriptorFactory
.fromResource(R.drawable.logo_small)));在google map对象上调用setInfoWindowAdapter()方法,并为smae标记设置一个较大的图像,首先将其移除
map.setInfoWindowAdapter(new InfoWindowAdapter() {
// Use default InfoWindow frame
@Override
public View getInfoWindow(Marker arg0) {
return null;
}
// Defines the contents of the InfoWindow
@Override
public View getInfoContents(Marker arg0) {
myMarker.remove();
myMarker= map
.addMarker(new MarkerOptions()
.position(pos)
.title(getResources().getString(R.string.reachUs))
.snippet("We are here")
.icon(BitmapDescriptorFactory
.fromResource(R.drawable.logo_large)));
return v;
}
});此外,如果你想让它再次变小,请使用切换或标志来再次设置小图像。
只需在标记上使用remove(),它就会起作用
发布于 2014-12-16 16:59:50
您应该处理标记单击事件并获取图像
myMap.setOnMarkerClickListener(MarkerClickListener);然后你必须从标记中获取图像,并在单独的图像视图中显示。要缩放或放大图像,您可以使用图像的任何缩放api Like Here
https://stackoverflow.com/questions/27500403
复制相似问题