Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Multimedia (https://www.delphipraxis.net/16-multimedia/)
-   -   Delphi Scanline Problem (https://www.delphipraxis.net/89788-scanline-problem.html)

Antigo 5. Apr 2007 17:56


Scanline Problem
 
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

xaromz 5. Apr 2007 18:00

Re: Scanline Problem
 
Hallo,

ist das Bitmap denn im Format 24Bit? Wenn nicht, dann setz das mal.

Gruß
xaromz

igel457 5. Apr 2007 18:01

Re: Scanline Problem
 
hast du auch...

Delphi-Quellcode:
imgs[0].PixelFormat := pf24Bit;
Vor der Verwendung von Scanline geschrieben?

Antigo 5. Apr 2007 18:02

Re: Scanline Problem
 
nein das hatte ich nicht. So funktionierts :)


danke :)


Alle Zeitangaben in WEZ +1. Es ist jetzt 10:43 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz