Re: analysing a bitmap
- From: Dodgy <Dodgy@xxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 25 May 2005 16:04:06 +0100
On Wed, 25 May 2005 16:35:48 +0200, "Peter Bauer"
<PeterBauer@xxxxxxxx> waffled on about something:
>
>> Then it exploded because you defined myimagemap as a 1 based array,
>> not 0 based one.
>
>i overwrite the array with:
>
> for y:= 0 to TempBitmap.Height-1 do
> begin
> P:= TempBitmap.ScanLine[y];
> for x:= 0 to TempBitmap.Width-1 do
> begin
> if (P^.rgbRed = 0) and (P^.rgbGreen = 0) and (P^.rgbBlue = 0) then
> MyImageMap[X, Y]:= 1
> else
> MyImageMap[X, Y]:= 0;
> end;
> end;
>
>so every black pixel is set as 1 in myimagemap
Sorry, I didn't mean the initial value of the individual array
elements, I mean the actual dimensions of the array as defined in you
code (copied below)
TCoordinateX = 1..242;
TCoordinateY = 1..102;
MyImageMap: array [TCoordinateX, TCoordinateY] of integer;
Your loop starts with x and y at zero, which means the first time you
try to set a pixel in MyImageMap you are setting MyImageMap[0,0] which
is outside the array, which on my D5 makes it go pop.
>> You appear to be getting stuck in a loop... As your fill routine is
>> self calling this eventually (i.e. a fraction of a second later) blows
>> the stack limit.
>>
>> I think this occurs when old colour=colour, although I haven't quite
>> got my head round your fill logic.
>
>thats right, now i'm skipping this with
> if OldColour=Colour then exit;
That would help. :-)
Dodgy.
--
MUSHROOMS ARE THE OPIATE OF THE MOOSES
.
- Follow-Ups:
- Re: analysing a bitmap
- From: Maarten Wiltink
- Re: analysing a bitmap
- From: Peter Bauer
- Re: analysing a bitmap
- References:
- analysing a bitmap
- From: Peter Bauer
- Re: analysing a bitmap
- From: Dodgy
- Re: analysing a bitmap
- From: Peter Bauer
- analysing a bitmap
- Prev by Date: Re: analysing a bitmap
- Next by Date: Re: analysing a bitmap
- Previous by thread: Re: analysing a bitmap
- Next by thread: Re: analysing a bitmap
- Index(es):
Relevant Pages
|
|