Re: analysing a bitmap
- From: Dodgy <Dodgy@xxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 25 May 2005 15:11:12 +0100
On Wed, 25 May 2005 15:06:02 +0200, "Peter Bauer"
<PeterBauer@xxxxxxxx> waffled on about something:
>i'm trying to copy all closed pixels of the same color of a bitmap (only
>black and white)
>
>i got an example on how to do this:
>
><snip>
>
>now i'm trying to modify this for bitmaps, but i allways get a
>stack-overflow in the fill() methode.
>i have no clue whats the problem :(
Really?
Not sure what version of Delphi you are using, but in D5 I had to
remove the variants reference, then change
TempBitmap.Assign(Image1.picture);
to
TempBitmap.Assign(Image1.picture.bitmap);
Then it exploded because you defined myimagemap as a 1 based array,
not 0 based one.
Okay, fixed that... Now the fill routine...
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.
It might be worth sticking some showmessages in your fill routine, or
dumping coordinates to a memo1 box so you can see where it's going,
and what it's doing.
With my test image the y coordinate decreased from where I started to
0 then sat going 0,1,0,1,0,1 until the stack went pop.
Dodgy.
--
MUSHROOMS ARE THE OPIATE OF THE MOOSES
.
- Follow-Ups:
- Re: analysing a bitmap
- From: Peter Bauer
- Re: analysing a bitmap
- References:
- analysing a bitmap
- From: Peter Bauer
- analysing a bitmap
- Prev by Date: Re: variable types unravel / RTTI
- Next by Date: Re: analysing a bitmap
- Previous by thread: analysing a bitmap
- Next by thread: Re: analysing a bitmap
- Index(es):
Relevant Pages
|
|