Re: analysing a bitmap



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
.



Relevant Pages

  • Re: How to get an associated file icon without the Alpha Channel i
    ... no reason for keeping it around after the end of the routine anyway, just make the OLE picture object own the handle and there's no ... You don't need to select the colour bitmap into the temporary DC, GetDIBitsjust requires a device context handle rather than ... Rather than filling out the header structure yourself, you can use GetDIBits() to do this for you - have a look at chapter 3 of the ... When you're editing the mask data, you're attempting to operate on it in the same way as the colour data by getting GetDIBitsto ...
    (microsoft.public.vb.winapi)
  • Re: Delphi Roadmap (by David I)
    ... The programloads a bitmap, and applies a gaussian blur to it. ... image was 4105x3182 pixels. ... Under win32, my gaussian blur routine uses 3.0-3.1 seconds per run, ... Without copying to and from this buffer, ...
    (borland.public.delphi.non-technical)
  • Re: Nobody likes BASICdraw
    ... It has received the worst ratings of any recent graphics program on ... Not a single person has posted a routine for it. ... bitmap (arbitrary shapes, or operations using a masking bitmap ... Nowadays, images can be huge. ...
    (comp.programming)
  • Re: buggy activity in compact .net app
    ... Calling Dispose (and maybe even ... > usefull either because the bitmap is created inside a routine. ... the local variables are destroyed. ...
    (microsoft.public.dotnet.framework.compactframework)