snapshot_win.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. // Copyright 2017 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef UI_SNAPSHOT_SNAPSHOT_WIN_H_
  5. #define UI_SNAPSHOT_SNAPSHOT_WIN_H_
  6. #include <windows.h>
  7. #include "ui/snapshot/snapshot_export.h"
  8. namespace gfx {
  9. class Image;
  10. class Rect;
  11. }
  12. namespace ui {
  13. namespace internal {
  14. // Grabs a snapshot of the desktop. No security checks are done. This is
  15. // intended to be used for debugging purposes where no BrowserProcess instance
  16. // is available (ie. tests). DO NOT use in a result of user action.
  17. //
  18. // snapshot_bounds_in_pixels is the area relative to clip_rect_in_pixels that
  19. // should be captured. Areas outside clip_rect_in_pixels are filled white.
  20. // clip_rect_in_pixels is relative to the client area of the window.
  21. SNAPSHOT_EXPORT bool GrabHwndSnapshot(
  22. HWND window_handle,
  23. const gfx::Rect& snapshot_bounds_in_pixels,
  24. const gfx::Rect& clip_rect_in_pixels,
  25. gfx::Image* image);
  26. } // namespace internal
  27. } // namespace ui
  28. #endif // UI_SNAPSHOT_SNAPSHOT_WIN_H_