Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Being able to capture part of the screen (Windows, UIItems, etc.) #260

Merged
merged 1 commit into from
Dec 23, 2015

Conversation

HEskandari
Copy link
Contributor

For approval tests to be more concise, you need to get screenshot of certain parts (UIItem) of the application. That's where the screenshot of the whole desktop won't be useful. I have created an overload where you can specify bounds for the screenshot.

Another change is making the screencapture class internal, as the interface to that is through the Desktop object.

Also note that I have taken a different approach to taking the screenshot so it relies only on managed code. Happy to send you another pull request to get rid of the unmanaged codes in ScreenCapture class.

/// Captures a screenshot of the provided boundary, and returns the bitmap
/// </summary>
/// <param name="bounds">Screen rectangle to capture</param>
public static Bitmap CaptureScreenshot(Rect bounds)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An method on window to expose this would be quite cool

@Roemer Roemer merged commit 8f51317 into TestStack:master Dec 23, 2015
@Roemer
Copy link
Collaborator

Roemer commented Dec 23, 2015

I merged this together with #350 to master. All IUIItems now expose the Capture method :)

@Roemer Roemer mentioned this pull request Dec 23, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants