Re: setting colormap for bitmaps
- From: Ron Steinke <rsteinke w-link net>
- To: otaylor redhat com, rsteinke w-link net
- Cc: gtk-devel-list gnome org
- Subject: Re: setting colormap for bitmaps
- Date: Tue, 17 Jul 2001 11:22:08 -0700
> From: Owen Taylor <otaylor redhat com>
>
> How did you want to intialize your bitmap? Say you wanted to initialize
> it to all zeros:
>
> GdkColor zero_color = { 0. };
>
> GdkGC *gc = gdk_gc_new (bitmap);
> gdk_gc_set_foreground (gc, &zero_color);
> gdk_draw_rectangle (rectangle, gc, TRUE, 0, 0, 100, 100);
>
> Or, as (perhaps you perhaps you had in mind above)
>
> GdkGC *gc = gdk_gc_new (bitmap);
> gdk_gc_set_function (gc, GDK_CLEAR);
> gdk_draw_rectangle (rectangle, gc, TRUE, 0, 0, 100, 100);
>
> Both work, and there shouldn't be a big difference in efficiency between
> them.
So you just set the pixel color directly. Thanks.
Ron
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]