Autor Beitrag
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: Do 08.09.05 20:31 
Ich hab es geschafft einen Screenshot über TCP Client/Server zu übertragen das funzt auch :D

Aber das Image flackert dann wenn jede Sekunde das Bild neu eingelesen wird. Das ist halt so. Aber kann man das irendwie unterbinden denn bei INIS Smile in der Schule funzt das auch, wobei dass da alles total verzögert ist aber das ist ja wieder nen anderes Thema.

Ich verwende folgende Procedure für screenshots:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
procedure ScreenShot(Bild: TBitMap);  
var
  c: TCanvas;  
  r: TRect;  
begin  
  c := TCanvas.Create;  
  c.Handle := GetWindowDC(GetDesktopWindow);  
  try  
    r := Rect(00, Screen.Width, Screen.Height);  
    Bild.Width := Screen.Width;  
    Bild.Height := Screen.Height;  
    Bild.Canvas.CopyRect(r, c, r);  
  finally  
    ReleaseDC(0, c.Handle);  
    c.Free;  
  end;
end;


Koller

Moderiert von user profile iconUGrohne: Beiträge zusammengefasst

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

Windows 8 , Server 2012
D7 Pro, VS.NET 2012 (C#)
BeitragVerfasst: Do 08.09.05 20:38 
Ich hab Deine zweite Frage gelöscht, weil sie hier nicht hergehört. Mach dafür bitte ein neues Topic auf.
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: Do 08.09.05 20:44 
ich versteht aber jetzt nicht mehr die frgae in dem thread oO
das bild flackert, denk mal dort wo es angezigt wird, das hat aber nichts mit dem screenshot amchen zu tun, sondenr mit dem anzeigen selber un da haste noch keinen code gepostet

_________________
wer andern eine grube gräbt hat ein grubengrabgerät
- oder einfach zu viel zeit
UGrohne
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Veteran
Beiträge: 5502
Erhaltene Danke: 220

Windows 8 , Server 2012
D7 Pro, VS.NET 2012 (C#)
BeitragVerfasst: Do 08.09.05 21:01 
user profile iconuall@ogc hat folgendes geschrieben:
ich versteht aber jetzt nicht mehr die frgae in dem thread oO
das bild flackert, denk mal dort wo es angezigt wird, das hat aber nichts mit dem screenshot amchen zu tun, sondenr mit dem anzeigen selber un da haste noch keinen code gepostet

OK, das war mein Fehler, der Code gehörte zu der zweiten Frage, ansonsten war bisher nichts an zusätzlichem Code dabei.

@Koller: Du solltest dazu wirklich noch etwas mehr Code liefern und auch sagen, in welchen Zeitabständen und wie die Übertragung erfolgt
Marco D. Threadstarter
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: Fr 09.09.05 14:32 
Titel: Screenshot
Das war wohl alles nen missverstängnis... naja egal :wink:

Also ich übertrage jede Sekunde per TCP CLient einen Filestream an TCp Server. Der empfängt das Bild (als die Bilddatei) und speichert sie. dann lädt image1 den Screenshot aus der Bilddatei. GEsendet wird jede Sekunde also kann man sagen dass auch jede sekunde neues bild geladen wird. Wie schon gesagt funzt das alles sehr schön nur halt dass das bei jedem neuladen flackert. :bawling:

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

FireFox 3, Internet Explorer 6 SP1
D1, D3Prof, D6Pers, D7Pers+Indy, VisualStudio Express
BeitragVerfasst: Fr 09.09.05 14:43 
Mhmm. Das ist jetzt sehr experimentell, aber wie wäre es, wenn du dir ein temporäres TImage hinter dein eigentliches legst, dem du das Bild erst empfängst und dann sobald geladen in das "eigentliche" lädst. Und immer so weiter:

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
1. Server sendet Bild 1
2. Client lädt Bild 1 vom Server in Image1
3. Client lädt Bild 1 aus Image1 in Image2
4. Server sendet Bild 2
5. Client lädt Bild 2 vom Server in Image1
...


slt, WeBBy ;)
Marco D. Threadstarter
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: Mo 12.09.05 20:45 
Titel: Screenshot
Also ich habs probiert wie Webspace gesagt hat und das Bild flackert trotzdem :bawling:

Also hier mein Code
ausblenden volle Höhe 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:
29:
30:
31:
32:
33:
34:
35:
procedure TForm1.IdTCPServer1Execute(AThread: TIdPeerThread);

var BILD:TFilestream;
    SizeOfIncomingStream: integer;
begin
  BILD := TFileStream.Create(ExtractFilePath(ParamStr(0)) + 'bild.bmp', fmCreate or fmShareExclusive);
  with AThread.Connection do
  begin
  try
      SizeOfIncomingStream := ReadInteger;
      ReadStream(BILD,SizeOfIncomingStream);
  finally
      BILD.Free;
      disconnect;
  end;
  end;
    //Image2.Picture.LoadFromFile(ExtractFilePath(ParamStr(0)) + 'bild.bmp');


  if modus=1 then
  begin
  image1.hide;
  image2.hide;
  image1.picture.LoadFromFile(extractfilepath(paramstr(0))+'bild.bmp');
  image1.show;
  modus:=2;
  end
  else begin
  image2.hide;
  image1.hide;
  image2.picture.LoadFromFile(extractfilepath(paramstr(0))+'bild.bmp');
  image2.show;
  modus:=1;
  end;
end;


Ich hab mal ein paar sleep-anweisungen eingefügt und das flackern war stärker. Das bedeutet wohl das es nicht schneller geht oder was? :?:

Koller

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
Marco D. Threadstarter
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: Do 15.09.05 17:30 
Titel: Flackern
Ich hab mein App mal hochgeladen. Hoffe mein Problem ist dann real zu erleben. Hoffe natürlich auch auf Lösungsvorschläge :wink:

Gruß Koller
Einloggen, um Attachments anzusehen!
_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
Teo
Hält's aus hier
Beiträge: 2

Windows 2000/XP
Delphi 4/7
BeitragVerfasst: Fr 07.10.05 08:34 
Das flackern ensteht beim zeichnen und wird nicht besser durch unsichtbar machen: beim anzeigen wird das Bild immer noch gezeichnet..

Mein Vorslag wäre: versuch mal ob es besser wird wenn du das Bild (TImage?) auf ein TPanel unterbringst und beim starten des clients (z.b. ins FormCreate) Panel1.Doublebuffered (oder Form.doublebuffered) verwendest.

Ob es damit vorbei ist kann ich nicht mit sicherheit sagen aber es würde mich nicht wundern.

Gruss,
Teo
ripper8472
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 114

Win2k (und wenn ich nen Zweitrechner haette, auch eine Linux Distri)

BeitragVerfasst: Fr 07.10.05 08:42 
nach dem zeichnen ein explizites .update; der komponente... hat bei mir manchmal geholfen
Alpha_Wolf
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 297

Ubuntu, Win XP, Win Vista
C#, Delphi 6 Prof, Delphi 2007 Prof, Java
BeitragVerfasst: Fr 07.10.05 09:44 
Wie schonmal beschrieben(Suche?!)

Das ganze ins Create.. dann dürfte es aufhören.. (getestet bei 20fps)

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
...   
var   
  lCounter: integer   
begin   
  for lCounter:= 0 to ComponentCount-1 do begin   
    if Components[lCounter].InheritsFrom(TWinControl) then begin   
      TWinControl(Components[lCounter]).DoubleBuffered:= true;   
    end;   
  end;   
end;

_________________
Diskutiere nie mit einem Irren - er zieht dich auf sein Niveau und schlägt dich mit seiner Erfahrung.
digi_c
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1905

W98, XP
D7 PE, Lazarus, WinAVR
BeitragVerfasst: Fr 07.10.05 11:38 
Benutzt man für sowas nicht UDP? Zumindest macht man das bei Videostreams so und dadurch ist doch auch die Bandbreite/Latenz besser ausgenutzt, oder :?
Marco D. Threadstarter
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: Fr 07.10.05 14:34 
Titel: S
hey leute danke! ich probiers mal aus, ich kanns aber nur in der schule testen, weil der Laptop von meinem Bruder grad nich da ist und bei uns 1 woche ferien sind. Aber vielleicht geht ich damal mit zum Kumpel der hat 2 pcs. Danke! :wink:
Koller

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot