菜鸟的疑惑,求注释
小弟刚接触GDI。大神帮我注释下下面的代码(通俗点,详细点,毕竟菜鸟嘛。0.0)。
public static Bitmap GetDesktop() { int screenX; int screenY; IntPtr hBmp; IntPtr hdcScreen = GetDC(GetDesktopWindow()); IntPtr hdcCompatible = CreateCompatibleDC(hdcScreen); screenX = GetSystemMetrics(0); screenY = GetSystemMetrics(1); hBmp = CreateCompatibleBitmap(hdcScreen, screenX, screenY); if (hBmp != IntPtr.Zero) { IntPtr hOldBmp = (IntPtr)SelectObject(hdcCompatible, hBmp); BitBlt(hdcCompatible, 0, 0, screenX, screenY, hdcScreen, 0, 0, 13369376); SelectObject(hdcCompatible, hOldBmp); DeleteDC(hdcCompatible); ReleaseDC(GetDesktopWindow(), hdcScreen); Bitmap bmp = System.Drawing.Image.FromHbitmap(hBmp); DeleteObject(hBmp); GC.Collect(); return bmp; }