Autor Beitrag
Delphianer23
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 156



BeitragVerfasst: Mo 03.02.03 20:59 
um screenshots zu machen , die direkt im Programm noch verarbeitet werden, muss ich entweder die Pixel des images ablesen, oder die des Bildschirms. Das ganze wird dann in ein BItmap geschrieben. Kennt einer von euch den Befehl?


so wird in das leere Bitmap geschrieben: Was muss ich in "Imagepixel" schreiben, damit entweder das ImageBild oder das Bild des gesamten Monitors ins Bitmap kommen?
(Bitmap1.canvas.draw(0,0,"Imagepixel"));
Andreas Pfau
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 997



BeitragVerfasst: Mo 03.02.03 21:38 
Also... ich muss ehrlich sagen, ich hab mir das 3 mal durchgelesen... was willst Du??? Formuliere dein Frage doch einfach so: "Was mussich tun, um...?". Villeicht stehe ich ja einfach nur auf dem Schlauch, aber ich glaube, du willst einfach nur 'nen Screenshot machen und in ein TBitmap laden, oder was?
Delphianer23 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 156



BeitragVerfasst: Mo 03.02.03 21:50 
ja genau, du hast es erfasst :) (EIn wunder bei meinem Text :oops: )

Wie geht es denn nun?
(screenshot in bitmap erstellen)
maximus
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 896

Win XP, Suse 8.1
Delphi 4/7/8 alles prof
BeitragVerfasst: Di 04.02.03 12:16 
teste mal dies:
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
var c:TCanvas;
    r: TRect;
begin
  c := TCanvas.Create;
  C.Handle := GetDC(HWND_DESKTOP);
  r := c.ClipRect;
  Image1.Canvas.CopyRect(rect(0,0,image1.Width,image1.Height) , C, r);
  ReleaseDC(HWND_DESKTOP, C.Handle);
  c.Free;
end;


viel spass
Delphianer23 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 156



BeitragVerfasst: Di 04.02.03 15:08 
Kapier ich nicht so recht, was soll den dass ganze rect da?

Und wie bekomm ich dass ganze auf ein Bitmap?? Wenn ich statt C, Bitmap1.canvas nehme sagt er mir dass nicht genug speicher vorhanden wäre. So funkzt es bei mir nicht.

Geht es nicht einfacher z. wie
ausblenden Quelltext
1:
Bitmap1.Canvas.draw (0,0, canvastobmp(image1.canvas));					

Mir fehlt gerade der Befehl: "canvastobmp" oder so ähnlich d.h Wie bekommt man aus nem image1.canvas die Bilddaten zum einlesen???

Moderiert von user profile iconTino: Code-Tags hinzugefügt.
smiegel
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 992
Erhaltene Danke: 1

WIN 7
D7 Prof., C#, RAD XE Prof.
BeitragVerfasst: Di 04.02.03 15:39 
Hallo,

vielleicht hilft das?

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
procedure ScreenShot(Bild: TBitMap); 
var c: TCanvas; 
    r: TRect; 
begin 
  c:=TCanvas.Create; 
  try 
    c.Handle:=GetWindowDC(0); 
    r:=Rect(0, 0, 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; // try
end; // ScreenShot


Aufgerufen wird das ganze dann so:
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
var ScreenBild:TBitmap;
  ...
  ...
  ScreenBild:=TBitmap.Create;
  try
    ScreenShot(ScreenBild);
    ScreenBild.SaveToFile('Screenshot.bmp');
  finally
    ScreenBild.Free;
  end; // try
  ...

_________________
Gruß Smiegel
Ich weiß, daß ich nichts weiß, aber ich weiß mehr als die, die nicht wissen, daß sie nichts wissen. (Sokrates)
Delphianer23 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 156



BeitragVerfasst: Di 04.02.03 16:00 
danke so klappt es :D
maximus
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 896

Win XP, Suse 8.1
Delphi 4/7/8 alles prof
BeitragVerfasst: Di 04.02.03 16:06 
genau. das gleiche in grün :lol:

dachte halt du könntest mein image1:TImage selbständig zu TBitmap umformulieren. Man will ja nicht immer alles vorkauen :wink:

mfg mx