Re: Creating an ROI (Region of Interest)



On 14 Mar 2001 20:49:07 -0800, Jerry Mulchin wrote:
> 
> I'm looking for a way to create a Region of Interest in an image. I want to be able create
> a rectangle that I can change the shape as I drag the mouse, and I want to be able to 
> place the ROI anywhere in the image. I would like the lines generated for the rectangle
> to be dashed or translucent, not solid lines if at all possible as it becomes a distraction.
> I also need to have the dimensions of the rectangle returned so that the area of the ROI 
> can be used to mark the processing area.
> 
> I've looked at all the Gtk+ stuff for creating rectangles and they all require predefined X/Y
> values to create the box. I need the box to be enlarged or shrunk by using the mouse
> directly. It can start out as a small rectangle, but it has to be changable by using the
> mouse.
> 
> Can anyone help me with code or URL locations that explain how to do this using Gtk+.
> 
> Thanks in Advance
> 
> Jerry Mulchin    Amateur Radio Call  -  N7EME
> Programmer, Amateur Astronomer, Ham Radio
> e-mail (home) - jmulchin astroguy com
> e-mail (work) - jmulchin cisco com
> Astronomy Web Page  http://www.astroguy.com
> "It is never wrong to ask a question, it is always wrong to be ignorant."
> 
> _______________________________________________
> gnome-devel-list mailing list
> gnome-devel-list gnome org
> http://mail.gnome.org/mailman/listinfo/gnome-devel-list

You'll have to take a look at the GDK-drawing functions. Besides that,
you'll probably follow this strategy:
1) Store a backing image as a copy of the original
2) When redrawing the ROI (on resize for example) first copy the backup
to the original (overwriting the previous ROI)
3) Draw the new ROI on the image

Improvements can be made by just redrawing that part of the image which
has changed. It really some deep GDK-programming you'll have to be
doing, i'm afraid. As Lauris Kaplinski pointed out, you could have a
look at Havoc's book, and of course the GDK/GTK Api-reference.

-- 
Jeroen Benckhuijsen

Software Engineer
Phoenix Software




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