简体   繁体   English

如何在不损失质量的情况下缩放屏幕截图?

[英]how to scale screenshot with out losing quality?

Now I am developing photography app for that I am developing pinch zooming and all apply effects selected image this is my code: 现在,我正在开发摄影应用程序,因为我正在开发捏缩放并全部应用所选图像的效果,这是我的代码:

      view = new SandboxView(getApplicationContext(), bmp);

And am adding this view to my frame layout. 并将此视图添加到我的框架布局中。 I am tacking screenshot of this layout for saving purpose,but it will gives based on screen width and screen height but I want with out losing image quality with 500*500 image. 我为保存目的添加了此布局的屏幕快照,但是它将基于屏幕宽度和屏幕高度给出,但我希望在不损失500 * 500图像的情况下获得图像质量。

What do you mean exactly when you say "without losing quality"? 当您说“不失去质量”时,您到底是什么意思? The only thing you can do is to use a smooth (but slow) scaling method. 您唯一可以做的就是使用平滑(但缓慢)的缩放方法。 But when you scale down your image will lose information (that's a mathematical fact) and therefore you will lose quality. 但是,当您按比例缩小图像时,将会丢失信息(这是一个数学事实),因此您将失去质量。 A good scaling algorithm will be able to show a picture that still looks nice to a human but there will be a loss. 良好的缩放算法将能够显示对人类仍然看起来不错的图片,但会造成损失。

And when you scale it to a bigger size using whatever scaling algorithm it will either look unsharp or bricky. 而且,当您使用任何缩放算法将其缩放到更大的尺寸时,它看起来都将变得不清晰或粗糙。 There you do not lose information but the visual quality is not as you would expect it from a native image of the upscaled size. 在那里,您不会丢失信息,但是视觉质量不会像您从放大尺寸的原始图像中所期望的那样。

So you only can save the original image and scale it to whateve size as soon as somebody wants to see it. 因此,您只能保存原始图像,并在有人希望看到它时立即将其缩放为任意大小。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM