[10521] in The GTK GIMP ToolKit mailing list archive

home help back first fref pref prev next nref lref last post

[gtk-list] Re: Drawing in GtkDrawingArea

daemon@ATHENA.MIT.EDU (Marsel Osipov)
Sun Nov 29 19:43:44 1998

Date: Sun, 29 Nov 1998 16:43:03 -0800
From: Marsel Osipov <virtuoso@jps.net>
To: gtk-list@redhat.com
Resent-From: gtk-list@redhat.com
Reply-To: gtk-list@redhat.com

Havoc Pennington wrote:

> On Sat, 28 Nov 1998, Marsel Osipov wrote:
> >
> > I did. I actually started with it. and it still does not work.
> >
>
> Post some code then, or give us more details. We can't guess what you're
> doing wrong.
>
> Havoc
>

void MyClass::displayPixel(RGBColor pixel, int x, int y)
{
  GdkColor *color;
  GdkGC * gc;
  gc = gdk_gc_new(d_area->window);

  color = (GdkColor *)malloc(sizeof(GdkColor));

  color->red = (gushort)pixel.red() * (65535/255);
  color->green = (gushort)pixel.green() * (65535/255);
  color->blue = (gushort)pixel.blue() * (65535/255);
  color->pixel = (gulong)(pixel.red()*65536 + pixel.green()*256 +
pixel.blue());
  gdk_color_alloc(gtk_widget_get_colormap(d_area), color);

  gdk_gc_set_foreground(gc, color);
  gdk_gc_set_background(gc, color);

  gdk_draw_point(pixmap,
   gc,
   x,
   y);



> --
> To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null




-- 
To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null


home help back first fref pref prev next nref lref last post