如何在android中裁剪解析后的图像?
我正在解析一个网站以显示 URL 中的内容,其中有一些图像。我想裁剪从网站解析的图像。我真的很苦恼,有人可以帮我解决这个问题吗?
I am parsing a website to display the contents in a URL, in that some images are there. I want to crop the images which are parsed from the site. I'm really struggling on this, can any one help me regarding on this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我假设您已经从网站上“获取”了图像并且想要调整大小而不是裁剪?即创建缩略图。
如果是这样,您可以使用以下方法:
I assume you've already "got" the images down from the website and want to resize rather than crop? I.e. create thumbnails.
If so, you can use the following:
最佳链接 github -> AndroidImageCrop
Best link github -> AndroidImageCrop
Android 联系人管理器 EditContactActivity 使用
Intent("com.android.camera.action.CROP")
这是示例代码:
然后,
startActivityWithResult()
来了解用户是否按下了确定或取消。在第一种情况下,裁剪后的图像将保存在uri
中。The Android Contact manager EditContactActivity uses
Intent("com.android.camera.action.CROP")
This is a sample code:
Then,
startActivityWithResult()
to known wether the user pressed OK or Cancel. In the first case, the croped image will be saved inuri
.