【发布时间】:2012-01-23 10:26:04
【问题描述】:
我正在使用以下意图来裁剪从图库中选择或由相机拍摄的图像:
Intent intent = new Intent("com.android.camera.action.CROP");
intent.setClassName("com.android.camera", "com.android.camera.CropImage");
但是,我还需要在该屏幕上添加旋转按钮。有没有办法做到这一点?
提前致谢。
【问题讨论】:
我正在使用以下意图来裁剪从图库中选择或由相机拍摄的图像:
Intent intent = new Intent("com.android.camera.action.CROP");
intent.setClassName("com.android.camera", "com.android.camera.CropImage");
但是,我还需要在该屏幕上添加旋转按钮。有没有办法做到这一点?
提前致谢。
【问题讨论】:
你不能这样做。因为您所说的 Activity 不是您的 Activity。
如果你真的需要这个,你必须实现你自己的裁剪功能。找到AOSP裁剪类对应的类,按需复用。
【讨论】:
试试这个:在一个普通按钮上设置一个onCLickListener,然后在里面执行你的rotate function。我真的不知道如何旋转,但以下可能会有所帮助:
Button rotateButton = (Button)findViewById(R.id.rotate_button);
rotateButton.setOnClickListener(new View.OnClickListener()
{
public void onClick(View v)
{
rotate();
}
});
protected void rotate()
{
// see below links for rotating stuff.
}
【讨论】: