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