Create image from Form/de
Deutsch · English
Für die Beispiele werden folgende Units benötigt:
...
uses
Graphics, Controls, Clipbrd, Forms, ...
...Die Funktion erstellt vom übergebenen Formular einen Bildschirmausdruck (Screenshot).
...
uses
Forms, Graphics, Controls, ...
...
Procedure subErstelleFormularImage(Formular: TForm; out Bitmap: TBitmap);
var
Breite: Integer;
Hoehe: Integer;
Rechteck: TRect;
begin
Breite := Formular.Width;
Hoehe := Formular.Height;
Rechteck := Rect(0, 0, Breite, Hoehe);
Bitmap.Width := Breite;
Bitmap.Height := Hoehe;
Bitmap.Canvas.CopyRect(Rechteck, Formular.Canvas, Rechteck);
end;Demonstration, wie z. B. die obige Funktion verwendet werden kann.
...
uses
Clipbrd, ...;
...
procedure Test;
var
Bitmap: TBitMap;
begin
...
// Fordert den Speicher für die Bitmap an
Bitmap := TBitmap.Create;
// Ruft die Funktion zum erstellen des Bildschirmausdrucks / Screenshots auf
subErstelleFormularImage(Form1, Bitmap);
// Beispiel 1: Weist den Screenschot einem Image zu
image1.Picture.Assign(Bitmap);
// Beispiel 2: Weist den Screenschot der Zwischenablage zu
Clipboard.Assign(Bitmap);
// Gibt den Speicher der Bitmap frei
FreeAndNil(Bitmap)
...
end;
...From the Free Pascal wiki, page "Create image from Form/de", as it stood on 2020-02-12 after a change by Trev, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's Licensing page. If you have concerns about this material, message the admin.
Edited on wiki.freepascal.org by 4 people, 2013–2020
From the official wiki's backup of 26 May 2024: who edited this page there, and when. Edits made there after that date were not recorded, and the earlier versions are not shown here; the main page says why.
| When | Who | What changed |
|---|---|---|
| Olaf | Created page | |
| Olaf | (minor) | |
| Olaf | (minor) | |
| Michl | ||
| Michl | ||
| FTurtle | ||
| Trev | Fixed syntax highlighting; deleted category already in page template (minor) |
Talk about this page
Nobody has opened a bench for this page yet. Sign in to open one.
