Autor Beitrag
Fighter#1
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 787

Win XP, Ubuntu 8.04
Turbo Delphi 2006, Delphi 2005 Pe, Delphi 5 Pe, Netbeans 6.1, Eclipse, Microsoft VisualC#, Dev C++, PHP, HTML, CSS
BeitragVerfasst: Do 10.05.07 12:08 
Hallo,
ich bearbeite Webcambilder mit verschiedenen funktionenen die mit Scanlines arbeiten.
Eine der funktionen ist diese, 1 zu 1 von dsdt.info kopiert :

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
procedure HorizontalSpiegeln(const Bitmap: TBitmap);
var i,j,w: Integer;
    rowin,rowout: pRGBArray;
begin
  w := bitmap.width*sizeof(TRGBTriple);
  Getmem(rowIn,w);
  try
    for j:= 0 to Bitmap.Height-1 do
    begin
      move(Bitmap.Scanline[j]^,rowin^,w);
      rowout := Bitmap.Scanline[j];
      for i := 0 to Bitmap.Width-1 do
        rowout[i] := rowin[Bitmap.Width-1-i];
    end;
    bitmap.Assign(bitmap);
  finally
    Freemem(rowin);
  end;
end;


Ich gehe davon aus das diese Funktion korrekt funktioniert, tut sie "normal" auch aber bei dem Webcambild tut sie das nicht!, also gehe ich davon aus dass es nicht! an der funktion liegt.

Der Fehler ist folgender.
Das Bild wird nur bis etwa 2/3 der Breite bearbeitet und gespiegelt! Im Gespiegelten Teil kann man ganz klar Linien von oben nach unten sehen und er ist grün!

Ich nehme an irgendwas stimmt mit dem zu bearbeitenden Bitmap nicht!

Ist es notwendig irgendwelche Vorkehrungen zu machen?

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
//Prozedur zum laden des Bilds :
//Wenn ich das Bild ohne den Umweg des Streams in Image1.picture.Bitmap lade dauert das bearbeiten mit der Spiegel funktion fast 700 ms :lol: drum dieser Ausweg
procedure bildmachen;
var bit:Tbitmap;
str:TMemoryStream;
begin
  With Form1 do begin
    SendMessage(ahandle,WM_CAP_EDIT_COPY,1,0);
    bit:=TBitmap.Create;
    str:=TMemoryStream.Create;
    bit.LoadFromClipboardFormat(cf_BitMap,ClipBoard.GetAsHandle(cf_Bitmap),0);
    bit.SaveToStream(str);
    str.Position:=0;
    Image1.Picture.Bitmap.LoadFromStream(str);
    str.Free;
    bit.Free;
  end;
end;
Einloggen, um Attachments anzusehen!
_________________
Wer andere beherrscht ist stark,
wer sich selbst beherrscht ist mächtig. Lao Tse
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10185
Erhaltene Danke: 1261

W11x64
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Do 10.05.07 12:41 
Moin!

user profile iconFighter#1 hat folgendes geschrieben:
Eine der funktionen ist diese, 1 zu 1 von dsdt.info kopiert:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
procedure HorizontalSpiegeln(const Bitmap: TBitmap);
var i,j,w: Integer;
    rowin,rowout: pRGBArray;
begin
  w := bitmap.width*sizeof(TRGBTriple);
  Getmem(rowIn,w);
//...

Wer sagt denn, dass das Bitmap pf24Bit Farbtiefe hat? :gruebel: Schonmal geschaut, was drin steht? ;)

cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.
Fighter#1 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 787

Win XP, Ubuntu 8.04
Turbo Delphi 2006, Delphi 2005 Pe, Delphi 5 Pe, Netbeans 6.1, Eclipse, Microsoft VisualC#, Dev C++, PHP, HTML, CSS
BeitragVerfasst: Do 10.05.07 12:48 
ok, habs rausgefunden bei PixelFormat steht pfDevice drin :lol: und was hab ich nun davon ??

Kann ich es im Nachhinein noch auf pf24bit ändern?

Blöde Frage. cool das wars! habs geändert und alles supi :-)
danke!

_________________
Wer andere beherrscht ist stark,
wer sich selbst beherrscht ist mächtig. Lao Tse