[gtkmm] is it possible?



hello, i'm begginer in the gtkmm and gtk

i need to draw a image from a pointer to a char in memory... it's
possibly with:

     GCTmp = get_style()->get_fg_gc(Gtk::STATE_NORMAL);
     get_window()->draw_rgb_image( GCTmp, 0, 0, width, height,
	Gdk::RGB_DITHER_NORMAL, imageBuffer, width * 3 );

but the buffer is in inverse byte_order and i need to draw it without
invert in my code...

is it possible?

i try use the gdk_draw_image but the result is a segmentation fault

GdkImage *image = gdk_image_new( GDK_IMAGE_NORMAL,                     
get_window()->get_visual()->gobj(),
                        width, height );               
image->parent_instance = *( ( GObject * ) gobj() );            
image->byte_order = GDK_LSB_FIRST;
image->width = width;
image->height = height;
image->depth = 24;
image->bpp = 3;
image->bpl = width * 3;
image->bits_per_pixel = 24;
image->mem = ( gpointer ) imageBuffer;
gdk_draw_image( ( get_window() )->gobj(), GCTmp->gobj(),
	image, 0, 0, 0, 0, width, height );

there are other way to do this without invert the bytes in my code?


thanks.... :-)




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