Autor Beitrag
JustusJonas
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 222



BeitragVerfasst: Sa 18.03.06 03:05 
Hallo Leute,

ich möchte nur von einem gewissen Teil des Bildschirms einen Screenshot erstellen.
Ich habe das bisher so gewählt, dass ich eine zweite halbtransparente Form anzeige. Mit dieser kann eine Auswahl getroffen werden. Danach übergebe ich die Position und die Größe an die Screenshot funktion:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
procedure TForm1.ScreenCapture(Bmp: TBitmap; Oben, Links, Hoehe, Breite: Integer);
var
  DeskWnd: HWnd;
  DeskDC: HDC;
  DeskCv: TCanvas;
  R: TRect;
  W, H: Integer;
begin
  if Bmp = nil then Exit;
  DeskWnd := GetDesktopWindow;
  DeskDC := GetWindowDC(DeskWnd);
  DeskCv := TCanvas.Create;
  DeskCv.Handle := DeskDC;
  W := Breite;
  H := Hoehe;
  R := Bounds(Links, Oben, W, H);
  try
    Bmp.HandleType := bmDIB;
    Bmp.PixelFormat := pf24Bit;
    Bmp.Width := W;
    Bmp.Height := H;
    Bmp.Canvas.CopyMode := cmSrcCopy;
    Bmp.Canvas.CopyRect(R, DeskCv, R);
  finally
    DeskCv.Free;
    ReleaseDC(DeskWnd, DeskDC);
  end;
end;


Mein Problem ist jetzt, dass die Auswahl zwar gemacht wird (das Bild ist im Endeffekt nur so groß), aber auf dem Bild ist alles nur weiß. Ich sehe nur etwas, wenn ich meine Auswahl genau auf mein 1. Formular setze. Dies sehe ich dann, alles dahinter ist wieder nur weiß.

Kann mir da jemand weiterhelfen?

Greetz
digi_c
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1905

W98, XP
D7 PE, Lazarus, WinAVR
BeitragVerfasst: Sa 18.03.06 09:15 
Hat zwar nichts mit dem Fehler zu tun aber ich würde als Parameter auch ein TRect nehmen.
Konnte keine Fehler im Vergleich zu www.swissdelphicente.../showcode.php?id=259 feststellen.
JustusJonas Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 222



BeitragVerfasst: Mo 20.03.06 23:51 
Kann mir keiner weiterhelfen?? :(

Greetz