如何使用c#提高图像质量 [英] How to improve the image quality using c#

查看:63
本文介绍了如何使用c#提高图像质量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须在本地机器上拍摄任何软件的安装屏幕截图。我使用psr.exe通过安装步骤拍摄所有屏幕截图。

psr的输出是.mht文件。我将打开mht文件并将.mht文件转换为.txt文件并提取所有图像和文本。

但图像质量不好,因为我们通过普通打印屏幕按钮获取图像。我们有什么方法可以提高图像质量吗?



//用于运行psr.exe //

I have to take screen shots of instalation of any software in local machine. I used psr.exe to take all the screen shots with installation steps.
The output of psr is an .mht file. I will open the mht file and convert .mht file to .txt file and extract all images and texts.
but the quality of images is not good as we get the images through normal print screen button. Do we have any methods to improve the image quality ?

// for run psr.exe //

//Starts PSR recording
               ProcessStartInfo p = new ProcessStartInfo();
               p.FileName = "psr.exe";
               p.Arguments = "/start /output " + @Output + "\\test-doc.zip /maxsc 100 /gui 0";
               Process.Start(p);

//for convert and save as image//

 // Convert Base64 String to byte[]
                byte[] imageBytes = Convert.FromBase64String(strFullpathNew);
                MemoryStream ms = new MemoryStream(imageBytes, 0, imageBytes.Length);

                // Convert byte[] to Image
                ms.Write(imageBytes, 0, imageBytes.Length);
                System.Drawing.Image image = System.Drawing.Image.FromStream(ms, true);

                //return image;

                var newImage = ScaleImage(image, 715, 521);

                image.Save(SourcesdirectoryPath + "\\" + "Image" + (i + 1) + ".Jpeg", ImageFormat.Jpeg);







请推荐一种方法来获得高质量的图像。

提前致谢




Please suggest a method to get the image with good quality.
Thanks in advance

推荐答案

CSI和NCIS等图像增强是虚构的:您无法增强图像来创建原始图像中没有的细节。特别是当原始截图基本上是屏幕的逐像素副本时。

如果您使用的应用程序拍摄图像,产生垃圾,再获取另一个!

您可以使用PrintScreen按钮手动完成,并在任何图形包中发布过程,或者有特定的应用程序将在热键上捕获屏幕 - 例如Corel ScreenCap。谷歌会找到你很多,我敢肯定。



另外一点你要注意:如果你想以任何方式处理图像,请存储它们在未压缩(位图)或非损耗压缩(PNG)格式中 - 避免像瘟疫一样的JPG或JPEG。每次保存JPG文件时,都会丢弃无法恢复的更多信息。 BMP或PNG文件不会发生这种情况。
CSI and NCIS etc. image enhancement is fiction: you cannot enhance an image to create detail that was not in the original image. Particularly when the original is a screenshot which is basically a pixel-by-pixel copy of the screen.
If the application you are using to take the images, produces rubbish, get another one!
You can do it manually with the PrintScreen button, and post process that in any graphics package, or there are specific applications which will capture the screen on a hot key - Corel ScreenCap for example. Google will find you plenty of them, I'm sure.

One other point you should be aware of: if you want to process images in any way, store them in an uncompressed (bitmap) or non-lossy compressed (PNG) format - avoid JPG or JPEG like the plague. Every time you save a JPG file, you throw away more info which cannot be recovered. This doesn't happen with BMP or PNG files.


这篇关于如何使用c#提高图像质量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆