Select an area of Gtk.Image

View: New views
2 Messages — Rating Filter:   Alert me  

Select an area of Gtk.Image

by skatm :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

What I'm trying to do is display and image and let the user select a rectangle area of the image and display the rectangle selection as they select it.

I thought I could do it by using Gtk.Image to display the image and use the ButtonPress, MotionNotify & ButtonRelease signals to capture the mouse input. My problem is I can't find anyway to overlay or draw the selected rectangle onto the Gtk.Image.

Is there anyway I can do this using Gtk#?

Thanks ,
Sam


Re: Select an area of Gtk.Image

by Andy Selvig :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

It seems like the easiest way is to use a Cairo to draw to a Gtk.DrawingArea. You can draw the image, then draw whatever overlays you'd like on top of it. You can create a Cairo context on a Gtk.DrawingArea using Gdk.CairoHelper.

On Thu, Sep 3, 2009 at 6:09 PM, skatm <jovisa737590@...> wrote:

Hello,

What I'm trying to do is display and image and let the user select a
rectangle area of the image and display the rectangle selection as they
select it.

I thought I could do it by using Gtk.Image to display the image and use the
ButtonPress, MotionNotify & ButtonRelease signals to capture the mouse
input. My problem is I can't find anyway to overlay or draw the selected
rectangle onto the Gtk.Image.

Is there anyway I can do this using Gtk#?

Thanks ,
Sam


--
View this message in context: http://www.nabble.com/Select-an-area-of-Gtk.Image-tp25285682p25285682.html
Sent from the Mono - Gtk# mailing list archive at Nabble.com.

_______________________________________________
Gtk-sharp-list maillist  -  Gtk-sharp-list@...
http://lists.ximian.com/mailman/listinfo/gtk-sharp-list


_______________________________________________
Gtk-sharp-list maillist  -  Gtk-sharp-list@...
http://lists.ximian.com/mailman/listinfo/gtk-sharp-list