Re: clearing a gdk_image through memset



MC_Vai <estoy ver megared net mx> writes:
En un Fri Jul/13/2001, a las 13:10:53, Havoc Pennington escribió:

  memset( (void *)oszi_image->mem,
          (int)black_color.pixel,
          sizeof(oszi_image->mem) * (oszi_height * oszi_width) );

This assumes that a pixel is 1 byte, and that sizeof(oszi_image->mem)
is 1, neither of which is true in general.

      So, what would be the right way to do it?


Read the Xlib Programming Manual (vol. 1 X book from O'Reilly). It
explains the format of an XImage. It's complicated and you don't want
to understand it though, I'll warn you in advance.

You are much better off using a GdkPixbuf for client-side image data,
since it has a fixed format. GdkImage is just the raw format of the
display hardware.

Havoc




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