下两个图片是一个程序,那个大神会做程序窗体,请截图给我,要是程序不对,可以给调试好发给我么?谢谢 10
1个回答
展开全部
截当前窗体的根据你的FORM改一下坐标
/// <summary>
/// 获取整个屏幕的图片
/// </summary>
/// <returns></returns>
public static Image GetScreenImage()
{
Image image = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height);
Graphics g = Graphics.FromImage(image);
g.CopyFromScreen(new Point(0, 0), new Point(0, 0), Screen.PrimaryScreen.Bounds.Size);
return image;
}
/// <summary>
/// 保存Jpg格式
/// </summary>
/// <param name="image">图像对象</param>
/// <param name="path">保存路径</param>
/// <param name="value">图像质量,1-100的范围,一般设置到60-80,太高图片容量会比较大</param>
public static void SaveJpg(Image image, string path, long value)
{
ImageCodecInfo icInfo = null;
ImageCodecInfo[] infos = ImageCodecInfo.GetImageEncoders();
foreach (ImageCodecInfo info in infos)
{
if (info.MimeType == "image/jpeg")
{
icInfo = info;
break;
}
}
EncoderParameters ep = new EncoderParameters(2);
ep.Param[0] = new EncoderParameter(Encoder.Quality, value);//质量,定义图片的清晰度
ep.Param[1] = new EncoderParameter(Encoder.Compression, (long)EncoderValue.CompressionLZW);//压缩,似乎无效果
image.Save(path, icInfo, ep);
image.Dispose();
}
追问
你搞错了吧
啥意思 看不懂
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询