Jump to content

Taking a screenshot of a control


 Share

Recommended Posts

I'm building an application that allows the user to take a screenshot of an internal IE object (using _IECreateEmbedded()).

More info in the spoiler if you wish, but it's not necessary to answer the question:

Spoiler

The application is basically a database program where the user creates categories (which are like tables but a bit more flexible), and can add entries to those categories. An entry has a number of fields including a URL and an image. If the user wishes they can browse the URL within the application and take a screenshot of the part of the website they're referencing.

At the moment I'm using _ScreenCapture_CaptureWnd() and it sort of works - but not exactly as intended. The problem is, I give the x1, y1, x2 and y2 coordinates of the embedded web object to _ScreenCapture_CaptureWnd() and the screenshot it gives back appears to be offset from it's actual position. I can manage to get things to line up properly by multiplying the coordinates by numbers I worked out through trial and error, but as soon as the window is moved it doesn't line up again.

I'm trying to work out what kind of things can offset coordinates. Can DPI affect this?

Is there a simple method of achieving this?

(Just to clarify: I only need to the visible part of the webpage in the screenshot)

Link to comment
Share on other sites

  • 2 weeks later...

Can we see some of your code? The bounds parameters are optional in _ScreenCapture_CaptureWnd() so if you just pass it the handle of the embedded IE object and leave the bounds to default shouldn't it just output the entire window?

UHJvZmVzc2lvbmFsIENvbXB1dGVyZXI=

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...