Re: flood fill



Thanks for the help! The image_get and then image_get_pixel sounds like a
good quick way of doing it (ignoring performance and overlapping
windows...for now)!  And yes..I can always write my own line draw proc.
giving me full access to all the boundary pixels! I did not do it as I
thought that It would be easier to capture the points from the window rather
than re-inventing the wheel.

I'll check out that client lib you mentioned.

Thanks again,
Saul.



> You can fetch the bitmap from the server with gdk_image_get(), or fetch a
> particular pixel with gdk_image_get_pixel().
>
> This is probably not a good solution though :-( it will be slow, it will
not
> work with half-obscured windows (you'd need to draw to an off-screen
window
> to avoid that), and the pixels you get back are rather close to the
hardware
> and difficult to reconstruct RGB from.
>
> You might be better off integrating your flood-fill into a client-side
> graphics library. You'd at least have a good knowledge of the pixel
layout.
> Maybe something like libart?
>
>   http://www.levien.com/libart/
>
> I'm sure there are many more. If you just need line draw, you can write
your
> own system pretty easily.
>
> John
>
> Saul Simhon wrote:
> > I wish I can use gdk_draw_polygon....However I need to plug in my own
> custom
> > flood fill algorithm. (its actually a texture synthesis method!)  I
> > basically need to iterate thorough the pixel array and detect what color
> the
> > pixel is and decide weather to continue to fill or stop (hit a
boundary).
> > I'm just not sure how to detect the color of a pixel on a drawable
widget?
> >
> > Thanks,
> > Saul.
> >
> >
> >>>I'm trying to write a custom procedure that would flood fill an area
> >
> > using a c
> >
> >>>olor (or texture). I have used the drawing_area widget
> >>>and drew an arbitrary closed polygon on it using the gdk_draw_line()
> >
> > function
> >
> >>>(black lines over a white background). All I need to do is fill in the
> >
> > pixels
> >
> >>>within the boundary. Does anyone know how I can get the boundary. (I
> >
> > obviously
> >
> >>>have the points of the polygon vertices, but I would need the scan-line
> >
> > point
> >
> >>>s generated from the draw_line function). Perhaps I can capture the
color
> >
> > at t
> >
> >>>he (x,y) positions? anyone know how?
> >>
> >>gdk_draw_polygon ?
> >>
> >>--p
> >>_______________________________________________
> >>gtk-list mailing list
> >>gtk-list gnome org
> >>http://mail.gnome.org/mailman/.listinfo/gtk-list
> >>
> >>
> >
> >
> > _______________________________________________
> > gtk-list mailing list
> > gtk-list gnome org
> > http://mail.gnome.org/mailman/listinfo/gtk-list
> >
>
>
>
>
> ==========================================================
>
> Madame de Pompadour
> Images of a Mistress
>
> 16 October 2002 - 12 January 2003
>
> For information and tickets:
> http://www.nationalgallery.org.uk/exhibitions/pompadour/default.htm
> _______________________________________________
> gtk-list mailing list
> gtk-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtk-list
>




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]