Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Taking a low-quality picture of the screen [closed]

Tags:

c#

image

I want to be able to take a low-quality image of the screen. I can take a bitmap picture, but no matter what I do I can't lower its quality.

like image 558
Joshua Coffey Avatar asked Jun 17 '11 23:06

Joshua Coffey


People also ask

How do I take a picture of my screen without losing quality?

Launch the screen that you want to capture and then press the PrintScreen button on your keyboard. This will copy the screen to the clipboard. Now press Ctrl + S in order to save your newly captured high-resolution screenshot in Windows.

Does a screenshot degrade quality?

The file format used when saving screenshots can also affect the image quality. Two of the most popular formats are jpg (lossy format) and png (lossless format). Your screenshots will look better if you save them with PNG, but the file size will be considerably larger compared to saving them with JPEG.

Does screen resolution affect screenshot?

Resolution makes a significant difference in the image quality of a screen shot. Resolution refers to the number of pixels (or dots) per inch of the image. A higher resolution means improved quality. There are steps you take to increase the resolution of your next screen shot.

Does Iphone screenshot reduce quality?

Screenshots should be in full resolution, but the way you send it to yourself may cause the resolution to be reduced. In particular, Google Inbox reduces the resolution of photos by default when emailing them. You should be okay sending it to yourself using Apple Mail, and selecting full resolution.


2 Answers

Image bmp1 = GetScreenImage ();

// Save the image as a GIF.
bmp1.Save("c:\\button.gif", System.Drawing.Imaging.ImageFormat.Gif);

Msdn for more.

like image 64
agent-j Avatar answered Sep 30 '22 19:09

agent-j


I would try converting the image to a compressed jpeg. The nice thing about jpegs is that you can set how high the quality should be (i.e. how much you want it compressed):

Note: quality should be between 1 and 100 (100 being the largest size/highest quality and 1 being the smallest size/lowest quality.

public void save(string filename, Bitmap img, int quality)
{
   // quality encoding
   EncoderParameter qualParam = new EncoderParameter(Encoder.Quality, quality);

   // code for jpeg image type
   ImageCodecInfo jpegCodec = FindEncoderInfo("image/jpeg");


   EncoderParameters encoderParams = new EncoderParameters(1);
   encoderParams.Param[0] = qualParam;

   img.Save(filename, jpegCodec, encoderParams);
}

private ImageCodecInfo FindEncoderInfo(string mimeType)
{
   // search through all codecs for all formats
   ImageCodecInfo[] codecs = ImageCodecInfo.GetImageEncoders();

   for (int i = 0; i < codecs.Length; i++)
   {
      if (codecs[i].MimeType == mimeType)
      {
         return codecs[i];
      }
   }
   return null;
}
like image 33
Jason Moore Avatar answered Sep 30 '22 21:09

Jason Moore