我也发过类似的帖子,但是没有找到满意的答案
解决方案 »
- C# 16进制数据显示问题
- 谁有 《Visual C#2005 程序开发与界面设计秘诀》源代码?
- 高分哭求gridview问题---请高手指点
- 用SQLDMO备份SQL2005数据库碰到的几个问题
- Rtf数据压缩与加密,用什么方法可以?
- 如何把EXCEL中的特定数据提取出来
- 为什么DataGridview的combobox下拉时背景就变黑了
- 新年散分之二
- 【求助】希望各位大神帮忙看一下程序的问题
- 请问image.Save();出现这种错误是怎么回事,有些图片可以但是有些图片就会出现这种错误
- 在BS里,遍历一个文件夹DOC1,看是否存在文件夹DOC2,如果有则将DOC2及其所属文件COPY到网页程序所在的文件夹下?如何实现。DOC1为物理路
- 如何獲得本地機的預設語言和地區設置
private static extern bool BitBlt(
IntPtr hdcDest, // handle to destination DC
int nXDest, // x-coord of destination upper-left corner
int nYDest, // y-coord of destination upper-left corner
int nWidth, // width of destination rectangle
int nHeight, // height of destination rectangle
IntPtr hdcSrc, // handle to source DC
int nXSrc, // x-coordinate of source upper-left corner
int nYSrc, // y-coordinate of source upper-left corner
System.Int32 dwRop // raster operation code
); [System.Runtime.InteropServices.DllImportAttribute("gdi32.dll")]
private static extern IntPtr CreateDC(
string lpszDriver, // driver name
string lpszDevice, // device name
string lpszOutput, // not used; should be NULL
IntPtr lpInitData // optional printer data
); private void PerformCapture()
{
this.Visible = false;
IntPtr dc1 = CreateDC("DISPLAY", null, null, (IntPtr)null);
Graphics g1 = Graphics.FromHdc(dc1);
MyImage = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height, g1);
Graphics g2 = Graphics.FromImage(MyImage);
Visible = false;
dc1 = g1.GetHdc();
IntPtr dc2 = g2.GetHdc();
BitBlt(dc2, 0, 0, Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height, dc1, 0, 0, 13369376);
g1.ReleaseHdc(dc1);
g2.ReleaseHdc(dc2);
MyImage.Save(@"c:\Captured.jpg", ImageFormat.Jpeg);
Visible = true;
MessageBox.Show("Finished Saving Image");
this.Visible = true;
this.SetBounds(0, 0, Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height);
SetupCropping();
firstCrop = true;
}