so far I did this much. I can compile it but when I run it, I don't see anything
procedure DrawBowTie( const xPaper: TImage ; // to draw upon const xColor: TColor ) ; // the pen color // Procedure to draw a BowTie on an Image. // The BowTie occupies from 1/4 to 3/4 of the Width of the Image, // and from 1/4 to 3/4 of the Height, with the pinch in the middle // of the Image. // Coordinates of the vertexes are calculated from the 1/4 values, // plus value, Mid, for the pinch area. var W1Q, H1Q, Mid: integer ; begin W1Q := xPaper.Width div 4 ; // 1/4 of the Width // 2 * W1Q is 2/4 (or 1/2) of the Width // 3 * W1Q is 3/4 of the Width H1Q := xPaper.Height div 4 ; // 1/4 of the Height // 2 * H1Q is 2/4 (or 1/2) of the Height // 3 * H1Q is 3/4 of the Height Mid := xPaper.Height div 20; // 1/20 of the Height (for Bow "Pinch") xPaper.Canvas.Pen.Color := xColor ; // set drawing color xPaper.Canvas.Polygon( [point( W1Q, H1Q), //upper left point(2*W1Q,2*H1Q-Mid), //upper middle pinch point(3*W1Q, H1Q), //upper right point(3*W1Q,3*H1Q), //lower right point(2*W1Q,2*H1Q+Mid), //lower middle pinch point( W1Q,3*H1Q)] ) //lower left end ; asked 10/25/2010 08:02 |