Autor Beitrag
-->Masterkill<--
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 24

XP Pro

BeitragVerfasst: Di 29.08.06 17:16 
Hi @all

Ich hab ma so ne Frage:

Also mit folgedem Code mach ich einen Screenshot:

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 ScreenCapture(Bmp: TBitmap);
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 := Screen.Width;
  H := Screen.Height;
  R := Bounds(0, 0, 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;


Nun will ich aber einen Screenshot nicht mit 800x600 Pixel oder weniger einen Screenshot machen. Wie kann ich das realisieren?

Vielen Dank im Vorraus
-->Masterkill<--
Marco D.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Di 29.08.06 17:22 
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 ScreenCapture(Bmp: TBitmap);
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 := Screen.Width;
  H := Screen.Height;

  R := Bounds(0, 0, 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;

Ich habe dir die wichtige Stelle markiert.

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8554
Erhaltene Danke: 481

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Di 29.08.06 17:23 
user profile icon-->Masterkill<-- hat folgendes geschrieben:
Nun will ich aber einen Screenshot nicht mit 800x600 Pixel oder weniger einen Screenshot machen.

Sorry, aber den Satz verstehe ich nicht.

Wenn du das Erstellen eines Screenshots nur bis (oder ab) einer gewissen Screen-Größe erlauben willst, dann frag zu Beginn der Prozedur einfach Screen.Width und Screen.Height ab.

Edit: Ich glaube, Marco meint dasselbe.

_________________
We are, we were and will not be.
Marco D.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Di 29.08.06 17:25 
user profile iconGausi hat folgendes geschrieben:
user profile icon-->Masterkill<-- hat folgendes geschrieben:
Nun will ich aber einen Screenshot nicht mit 800x600 Pixel oder weniger einen Screenshot machen.

Sorry, aber den Satz verstehe ich nicht.

Ich irgendwie auch nicht. :lol:

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
-->Masterkill<-- Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 24

XP Pro

BeitragVerfasst: Di 29.08.06 17:44 
Sorry schneller gedacht als getippt also er sollte so sein:

Nun will ich aber einen Screenshot nicht mit 1024x768 Pixel sondern mit 800x600 Pixel oder weniger machen.


Und danke für die Antwort
-->Masterkill<-- Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 24

XP Pro

BeitragVerfasst: Di 29.08.06 17:47 
Nun habe ich das so umgeändert:

[highlight]W := 640;
H := 720;[/highlight]

Nun ist es klar er macht das ganze mit 640x720 Pixeln aber eben auch nicht den ganzen bildschirm.
Wie kann ich es denn machen dass er den janzen Bildschrim aufzeichnet aber in einer beliebigen auflösung?
mFG masterkill
Robert.Wachtel
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 895
Erhaltene Danke: 7

Windows 7 Ultimate x64
D5 Ent, D7 Arch, RAD Studio 2010 Pro, VS 2008
BeitragVerfasst: Di 29.08.06 17:50 
Du willst skalieren?
-->Masterkill<-- Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 24

XP Pro

BeitragVerfasst: Di 29.08.06 17:51 
bingo :wink:
Bääääär
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 117



BeitragVerfasst: Mi 30.08.06 09:33 
Hä?

Wie jetzt? Willst du einen Screenshot mit 800x600 oder kleiner machen, oder willst du einen größeren machen, aber dein Code macht das nicht?
-->Masterkill<-- Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 24

XP Pro

BeitragVerfasst: Mi 30.08.06 15:35 
Mmmh ich dachte es wäre klar...
Also nochmal ich möchte einen kleinern Screenshot machen, Beispielsweise mit einer Auflösung on 600x800 Pixeln.

PS: Trotzdem soll der ganze Bild schirm drauf sein

MFG Masterkill
elundril
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3747
Erhaltene Danke: 123

Windows Vista, Ubuntu
Delphi 7 PE "Codename: Aurora", Eclipse Ganymede
BeitragVerfasst: Mi 30.08.06 15:45 
er will zb einen 1024x768 bildschrim screenshot auf 800x600 skalieren!

such mal in [url]www.dsdt.info[/url] in den Tutorials und tipps! da findest du sicher was!

mfg el

_________________
This Signature-Space is intentionally left blank.
Bei Beschwerden, bitte den Beschwerdebutton (gekennzeichnet mit PN) verwenden.
uall@ogc
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1826
Erhaltene Danke: 11

Win 2000 & VMware
Delphi 3 Prof, Delphi 7 Prof
BeitragVerfasst: Mi 30.08.06 15:47 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
procedure ScreenShot(var bmp: TBitmap);
var dc: Integer;
begin
  bmp.width := 800;
  bmp.height := 600;
  dc := GetDC(0);
  StretchBlt(bmp.canvas.handle,0,0,800,600,dc,0,0,screen.width,screen.height,srccopy);
  ReleaseDC(0,dc);
end;

// ungetestet, einfach mal so hingeschrieben ;P

_________________
wer andern eine grube gräbt hat ein grubengrabgerät
- oder einfach zu viel zeit
elundril
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3747
Erhaltene Danke: 123

Windows Vista, Ubuntu
Delphi 7 PE "Codename: Aurora", Eclipse Ganymede
BeitragVerfasst: Mi 30.08.06 15:48 
jep genau des is es!!!!! ALSO LIEBER MASTERKILL: VIEL SPASS DAMIT!!!!

_________________
This Signature-Space is intentionally left blank.
Bei Beschwerden, bitte den Beschwerdebutton (gekennzeichnet mit PN) verwenden.
-->Masterkill<-- Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 24

XP Pro

BeitragVerfasst: Mi 30.08.06 18:43 
DANKE ES GEHT :D :!: :!: :!: :!: :!: :!: :!:

gruß masterkill