Hi Chen, For the application that you described, using a canvas doesn't give you much and you can just as well create a cairo context and draw on the image directly. But there are a few things that you should be aware of:
- Drawing overlays on av full realtime speed is going to take a lot of CPU no matter how fast you do it. - You should make sure to prepare all the data offline before you ship it off to the screen. Thus don't put the data from the frame grabber on the screen until after you have annotated it. - If the annotation is static, it certainly faster to prepare a transparent pixbuf and draw the annotation on the pixbuf and then simply merge the data from the frame grabber with the overlay mostly transparent pixbuf, and then ship the result of to display. - If you want the user to be able to interactively zoom the resulting pixbuf, you may want to have a look at my GtkImageViewer that creates such a zoomable interface for you. See the tutorial at: http://giv.sourceforge.net/gtk-image-viewer/ Regards, Dov 2009/3/26 chen zhixin <thexin1...@gmail.com> > Program need to draw realtime lines on per frame,first time i use > cairo_surface_create_similar and draw surface on the frame. > (frame draw on GtkDrawingArea),this make fast on my pc and the > Machine(use slitaz system),but when i use ubuntu on the machine,the > Xorg process take 100% cpu,this make me craze,i still don't kown why. > > I want to use canvas to change this,there are some cairo > canvas,goocanvas can be found in lib.gnome.org,it will be a part of > gnome? > goocanvas vs crcanvas ,which should i use? or somebody have a good > method to do these. > > software do these: > 1. capture frame from TV card by V4L2,and then change fmt from yuyv to > gray. > 2. draw gray frame to GtkDrawingarea by gdk_draw_gray to a GdkPixmap. > 3. do some other things on the GdkPixmap,such as draw pixbuf and > text,and then gdk_draw_drawable. > 4. measure on the drawingarea.such as > line,circle,ellipse,polygon,arrow,draw results on the frame. > 5. do other things ,such as zoom,save as image,video. > > there are some problems: > 1. can create cairo surface on GRAY picture,then i can draw something on it > ? > _______________________________________________ > gtk-app-devel-list mailing list > gtk-app-devel-list@gnome.org > http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list > _______________________________________________ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list