cosmos

Taking a screenshot of a control

3 posts in this topic

#1 ·  Posted

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)

Share this post


Link to post
Share on other sites



#2 ·  Posted

Not sure if you're allowed to bump topics but I couldn't find anything saying you can't. :)

Share this post


Link to post
Share on other sites

#3 ·  Posted

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=

Share this post


Link to post
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