Thema: Delphi Scanline Problem

Einzelnen Beitrag anzeigen

Antigo

Registriert seit: 14. Mär 2005
274 Beiträge
 
#1

Scanline Problem

  Alt 5. Apr 2007, 17:56
Hi,
Ich habe ein problem mit der Scanline Funktion des TBitmaps.

Das ganze funktioniert nämlich nicht mit einem frisch erstellten Bitmap.

Folgendes klappt:

Delphi-Quellcode:
   imgs[0].loadfromfile('....');
  P:=imgs[0].ScanLine[5];
  for i:= 0 to imgs[0].width-1 do
  begin
    P^.rgbtRed:=0;
    P^.rgbtBlue:=0;
    P^.rgbtGreen:=0;
    inc(P);
  end;
wenn ich das bitmap auf eine paintbox male, habe ich einen schwarzen strich in der 5ten Zeile. Mache ich aber folgendes:

Delphi-Quellcode:
  imgs[0]:=TBitmap.Create;
  imgs[0].Height:=100;
  imgs[0].Width:=100;
  P:=imgs[0].ScanLine[5];
  for i:= 0 to imgs[0].width-1 do
  begin
    P^.rgbtRed:=0;
    P^.rgbtBlue:=0;
    P^.rgbtGreen:=0;
    inc(P);
  end;
so bleibt das Bitmap komplett weiss. Was mache ich falsch?


Vielen Dank schonmal im vorraus

mfg
Antigo
Michael
"How should I know if it works? That's what beta testers are for. I only coded it."
  Mit Zitat antworten Zitat