捕捉电脑桌面并且保存为图片(大哥大姐帮帮忙) 写一个程序可以自动捕捉电脑桌面并且保存为图片然后发送给另一台电脑 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 http://www.cnblogs.com/dingshouqing/archive/2011/10/19/2217194.html使用截图,然后发送图片 已实验通过。欢迎大家拍砖 class Program { [System.Runtime.InteropServices.DllImport("gdi32.dll")] public static extern bool BitBlt( IntPtr hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, IntPtr hdcsrc, int nXSrc, int nYSrc, System.Int32 dwRop); public static Bitmap WindowFullScreen() { Graphics grpScreen = Graphics.FromHwnd(IntPtr.Zero); Bitmap bitmap = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height, grpScreen); Graphics grpBitmap = Graphics.FromImage(bitmap); IntPtr hdcScreen = grpScreen.GetHdc(); IntPtr hdcBitmap = grpBitmap.GetHdc(); BitBlt(hdcBitmap, 0, 0, bitmap.Width, bitmap.Height, hdcScreen, 0, 0, 0x00cc0020); grpBitmap.ReleaseHdc(hdcBitmap); grpScreen.ReleaseHdc(hdcScreen); grpBitmap.Dispose(); grpScreen.Dispose(); return bitmap; } static void Main(string[] args) { Image image= WindowFullScreen() ; image.Save(@"\\v-lihjia1\Temp\New folder\1.jpg");//为远程电脑路径,需有写权限 Console.ReadKey(); } } 客户端调用Web Service如何设置超时时间? 请教:进度条的问题? 再次提问ROW_NUMBER函数分页 [求助]关于页面间的参数传递的问题!? 懂Microsoft Visual Studio .NET 2003的进来一下. 做登陆界面时,怎样去掉最大化按钮。我的意思是不显示这个按钮。 asp.net 怎么调用 csp() supermap开发 C# buffer参数问题 菜鸡求教关于C#绘制窗口与屏幕截取 WINFROM 做为基类, 继承这个基类 的父类,如何修改基类的默认值 C#进行网站开发的时候,组件是如何选择的? 继电保护 接线图,希望高手指点
使用截图,然后发送图片
class Program
{
[System.Runtime.InteropServices.DllImport("gdi32.dll")]
public static extern bool BitBlt(
IntPtr hdcDest,
int nXDest,
int nYDest,
int nWidth,
int nHeight,
IntPtr hdcsrc,
int nXSrc,
int nYSrc,
System.Int32 dwRop); public static Bitmap WindowFullScreen()
{
Graphics grpScreen = Graphics.FromHwnd(IntPtr.Zero);
Bitmap bitmap = new Bitmap(Screen.PrimaryScreen.Bounds.Width,
Screen.PrimaryScreen.Bounds.Height, grpScreen);
Graphics grpBitmap = Graphics.FromImage(bitmap);
IntPtr hdcScreen = grpScreen.GetHdc();
IntPtr hdcBitmap = grpBitmap.GetHdc();
BitBlt(hdcBitmap, 0, 0, bitmap.Width, bitmap.Height, hdcScreen, 0, 0, 0x00cc0020);
grpBitmap.ReleaseHdc(hdcBitmap);
grpScreen.ReleaseHdc(hdcScreen);
grpBitmap.Dispose();
grpScreen.Dispose();
return bitmap;
} static void Main(string[] args)
{
Image image= WindowFullScreen() ;
image.Save(@"\\v-lihjia1\Temp\New folder\1.jpg");//为远程电脑路径,需有写权限
Console.ReadKey();
}
}