Re: Copying bitmaps into bitmaps



On Thu 17 Jan 2002 14:21, Havoc Pennington wrote:
> Edscott Wilson García <edscott imp mx> writes:
> > But isn't a bitmap nothing more than a pixmap of depth 1? If
> > gdk_pixmap_new(window,pix_w,pix_h,1);
> > is not the correct way to create an empty bitmap with gtk, how should it
> > be created?
>
> That is the right way. One of us is missing some detail.
>

Its as simple as the following code, where gPIM[0] is a valid and working 
GdkBitmap with width pix_w and height pix_h,  and h is a gtkdialog.

static GdkBitmap *gPM;

static void create_higher_bitmap(){
	/* This should work, but it doesn't */
  GdkGC *gc; 
  gPM=gdk_pixmap_new (h->window,pix_w,pix_h,1);
  if (!gPIM){fprintf(stderr,"xftree: error 3348\n");return;}
  gc = gdk_gc_new (h->window);
  gdk_draw_pixmap(gPM,gc,gPIM[0],0,0,0,0,pix_w,pix_h);
  gdk_gc_destroy (gc);
  return; 
}

gdk_pixmap_new does not return NULL. 
Maybe I'm screwing up with the gc which should have special considerations 
for bitmap working.
Maybe there's something particular with src_private->xwindow or 
drawable_private->xwindow:

  XCopyArea (drawable_private->xdisplay,
	     src_private->xwindow,
	     drawable_private->xwindow,
	     gc_private->xgc,
	     xsrc, ysrc,
	     width, height,
	     xdest, ydest);



edscott



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