Autor Beitrag
.50AE
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 100



BeitragVerfasst: Sa 06.05.06 16:45 
Hallo

Ich versuche gerade alle Punkte (oder auch irgendeinen) einer bestimmten Farbe in einem bmp zu finden.
Dazu geh ich eben jedes Pixel durch und prüf die Farbe..

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
for y := 0 to image.Height - 1 do begin
  for x := 0 to image.Width - 1 do begin
  if image.Canvas.Pixels[y,x] = [i][ausgelesene farbe (GEHT GANZ SICHER)][/i] then begin
    gefunden := true;
    image.Canvas.Rectangle(x-2,y-2,x+2,y+2);
    end;
  end;
end;
if (gefunden = true) then showmessage('blabla');


Allerdings geht das nicht so wirklich... Wenn ich z.B. mit der Maus auf einen Punkt klicke, dessen Farbe auslese und dann prüfe, ob er im Bild vorkommt, erhalte ich weder eine nachricht noch ein einkekreistes pixel..

wenn ich nach $00FFFFFF (weiß) suche kreist er irgendwelche pixel am linken rand (oder in der nähe davon) ein; die sind aber garantiert nicht weiß!


HELPME
MfG
.50AE
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: Sa 06.05.06 18:50 
image.Canvas.Pixels[y,x]

x und y sind vertauscht

_________________
wer andern eine grube gräbt hat ein grubengrabgerät
- oder einfach zu viel zeit
.50AE Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 100



BeitragVerfasst: Sa 06.05.06 19:07 
Oh man, so ne Klitzekleiigkeit!!!

Das werd ich jetzt in Zukunft zumindest NIE MEHR!!! falschmachen..

Also vielen Dank, .50AE