swarm-support
[Top][All Lists]
Advanced

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

Re: How to draw a line in a Raster object?


From: Kevin Crowston
Subject: Re: How to draw a line in a Raster object?
Date: Wed, 30 Apr 1997 15:27:35 -0500

>Hi folks.  I'm hoping to draw interesting things on a Raster object.  Have
>discovered the "draw" method supported by Raster, but don't understand how
>to use it.  For example, I'd like to call the "draw" method and tell it to
>use the Xlib XDrawLine routine to draw a line.  Clues are below, but how to
>put it all together?  That is, how do I complete this code fragment:

I just defined my own kind of Raster and added the following method

-drawLineX1: (int) x1 Y1: (int) y1 X2: (int) x2 Y2: (int) y2 Color: (Color) c {
  int zoomRaster ;

  zoomRaster = [super getZoomFactor] ;

  XSetForeground(display, gc, map[c]);            // no checking on map.

  XDrawLine(display, pm, gc, zoomRaster * x1, zoomRaster * y1,
                             zoomRaster * x2, zoomRaster * y2) ;
  return self;
}



Kevin



                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of Swarm.  For list administration needs (esp.
   [un]subscribing), please send a message to <address@hidden>
   with "help" in the body of the message.
                  ==================================


reply via email to

[Prev in Thread] Current Thread [Next in Thread]