HMG Help

Exclusive forum for HMG, a Free / Open Source xBase WIN32/64 Bits / GUI Development System
  1. Probaste el ejemplo que te menciono Kevin ???
    ---------------------------------------------------------
    Did you try the example that Kevin mentioned to you ???

    Polygon.png

    Statistics: Posted by andyglezl — Sat May 26, 2018 2:36 am


  2. Kevin

    The error I get is

    Error E0030 Syntax error "syntax error at 'POLYGON'"

    Thanks for your reply

    Statistics: Posted by bluebird — Fri May 25, 2018 10:14 pm


  3. Thanks Andy. but I still get syntax error if I include the line below:

    I have not been successful in finding an example of drawing a polygon with HMG
    In the code below it does not make a difference if I write it out on one line, or use the semi colons.

    What am I doing wrong ???? :(

    Private aSelectedColors:={{199,21,133},{205,90,162},{90,162,205},{170,95,142},{93,50,165}} //defined ahead of call to do rectangles and polygons


    DRAW POLYGON IN WINDOW Win_Wall;
    POINTS {{50,50},{10,200},{300,200},{390,50},{50,50}} ;
    PENCOLOR {61,82,200} ;
    PENWIDTH 4 ;
    FILLCOLOR aSelectedColors[1] //left wall
    What error exactly are you getting?

    Check out \SAMPLES\Controls\Graph\GRAPH_01\demo.prg . It compiles and runs fine for me. It draws several shapes, including a polygon. The polygon it draws has 7 sides, and there are 7 coordinate pairs in POINTS. You must look closely to see the 7 sides, as two of them are nearly in the same line.

    Kevin

    Statistics: Posted by kcarmody — Fri May 25, 2018 7:37 pm


  4. Thanks Andy. but I still get syntax error if I include the line below:

    I have not been successful in finding an example of drawing a polygon with HMG
    In the code below it does not make a difference if I write it out on one line, or use the semi colons.

    What am I doing wrong ???? :(

    Private aSelectedColors:={{199,21,133},{205,90,162},{90,162,205},{170,95,142},{93,50,165}} //defined ahead of call to do rectangles and polygons


    DRAW POLYGON IN WINDOW Win_Wall;
    POINTS {{50,50},{10,200},{300,200},{390,50},{50,50}} ;
    PENCOLOR {61,82,200} ;
    PENWIDTH 4 ;
    FILLCOLOR aSelectedColors[1] //left wall

    Statistics: Posted by bluebird — Fri May 25, 2018 4:46 pm


  5. Thanks for the excellent observation

    I tought that I only had to give the polygon 4 points just like the rectangle.
    Should have thought of what "poly" means.

    Gracious, and good luck Mexico with NAFTA :)

    Statistics: Posted by bluebird — Fri May 25, 2018 4:28 am