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?

ardnew
  • 1,780
  • 16
  • 26
  • Are you tried the [`GetFormImage`](http://docwiki.embarcadero.com/Libraries/en/Vcl.Forms.TCustomForm.GetFormImage) method ? ; – RRUZ May 24 '12 at 16:18
  • Yep, `GetFormImage` is what we're currently using. – ardnew May 24 '12 at 16:22
  • 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. – ardnew May 24 '12 at 16:25

1 Answers1

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.

Uwe Raabe
  • 39,888
  • 3
  • 77
  • 115