Re: A Line in a Pixbuf



Hallo,

thanks for trying to help me. Thanks for your code but
I think it is for GTK 1.2. I forget to say that my
programm is written in GTK 2.x (or must I only change
the compiler call?).

If you send me a small exampel I can show you how to
modify this to draw on the pixmap...
I want to draw a red line from x1 = 100, y1 = 25 to x2
= 150, y2 = 175. This is my funcion for loading an
image in a pixbuf:

void pixbufindrawingareadarstellung (GtkWidget
*bilddrawingarea, gchar *bildnamemitpfad /* path vor
image.png*/)
{
    GdkPixbuf *pixbuf;
    GError *err = NULL;
    gint image_width;
    gint image_height;


 
    if (bildnamemitpfad != NULL ) 
{
pixbuf = gdk_pixbuf_new_from_file (bildnamemitpfad,
&err);
//Perhaps I can add here my red line in pixbuf here?

image_width = gdk_pixbuf_get_width(pixbuf);
image_height = gdk_pixbuf_get_height(pixbuf);

gdk_pixbuf_render_to_drawable(pixbuf,
  bilddrawingarea->window,
  bilddrawingarea->style->fg_gc[GTK_STATE_NORMAL],
0, 0, 0, 0, image_width, image_height,
  GDK_RGB_DITHER_MAX, 0, 0);
g_object_unref(pixbuf);
//Or I can add my line here directly in Drawing area?
         )
}

Perhaps somebody can help better know ...

Regards

Christian Schneider


        
                
Mit schönen Grüßen von Yahoo! Mail - http://mail.yahoo.de



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