Screenshot of form whose dimensions are greater than screen dimensions
Asked Answered
A

1

7

I have a TForm object whose height is greater than the required vertical resolution of my screen.

For some reason, Windows doesn't allow the visible (client?) area of the form to exceed the screen resolution, so vertical scrollbars appear on my form.

How would I get a TBitmap image or screenshot of the entire form (no scrollbars, all form components visible) so that all content of the form is visible?

Apiary answered 24/5, 2012 at 15:57 Comment(3)
Are you tried the GetFormImage method ? ;Shanney
Yep, GetFormImage is what we're currently using.Apiary
For example, create a TForm object, place a lot of vertical content to cause your (enabled) vertical scrollbars to automatically appear. The total height of the content should exceed your vertical screen resolution. Call GetFormImage, and you will see that lower content is discarded.Apiary
P
9

At first you have to make sure the form has no scrollbars. For that you can write an event handler for FormConstrainedResize and adjust MaxWidth and MaxHeight to your needs. If the form size is restricted during design, set the required Width and Height in the FormCreate event to the desired values.

Now you can use GetFormImage to get the screenshot.

Pudendum answered 24/5, 2012 at 16:26 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.