No announcement yet.

New EZGUI Custom control ! (vector graphics) for use with DDT

  • Filter
  • Time
  • Show
Clear All
new posts

  • New EZGUI Custom control ! (vector graphics) for use with DDT

    I am happy to annouce the release of the first (of hopefully many more) standalone EZGUI custom controls for use with either DDT or SDK style coding.

    Today is the official release of:

    The EZGUI Turtle Graphics control SV (standalone) 4.0.


    This control is a 41 KB (size) DLL which is a true Windows control.

    You can use it with PB Forms (DDT) or any other Designer which supports custom controls (you may have to create the control definition file if a designer requires it).

    The control is extremely easy to use.

    Now for some details about the control.

    (1) It is vector based, rather than raster based.
    The control uses the EZGUI Turtle Graphics macro language to draw images. Images are scalable, since it is defined using coordinates (vectors) and drawing commands, rather than bitmaps.

    (2) The control can respond to mouse clicks (through WM_COMMAND so events are passed to DDT callback routines). You can get the actual pixel coordinate or have it converted to a view coordinate (based on the view defined in the Turtle code) for the last mouse click during the events.

    (3) You can draw text, lines, lines based on angles, rectangles, ellipses and rectangular gradients. You can also animate frames (up to 100) and automate the graphics to produce animation style effects. Polygons can be drawn using the L (line) macro using degrees and and a repeat factor.
    Simply pass a Turtle Graphic macro string via CONTROL SET TEXT (or SetWindowText or WM_SETTEXT)

    (4) There are supporting messages (use CONTROL SEND or SendMessage) to access data from the control (last mouse click coordinate, bitmap handle).

    (5) Access the Turtle Graphics engine, without a Turtle control!
    Use this engine (via a SUB call to DLL) to draw a Turtle Graphic macro string to any DC, including printers.

    (6) By using the Turtle Graphic engine directly, you can even draw Turtle Graphics macros on the PB Graphic control.

    SUB DrawOnPBGraphicControl(BYVAL D$)
         LOCAL hDC&, DW&, DH&, W&, H&, EFlag&
         DIALOG UNITS hForm1&, DW&, DH& TO PIXELS W&, H&
         EZ_RenderTurtle  D$, hDC&,0,0, W&, H&, EFlag&
    (7) There is no limit of the number of Turtle Graphic controls you can have on a Dialog.

    The control comes with a sample app written using DDT, which demonstrates different Turtle macros, including animated graphics, plus drawing on a PB Graphic control.

    There is a (152 KB) HTML Help file that explains all the details about the control.

    Lastly, the Price is right!

    Only $24.95 (US)

    Last edited by Chris Boss; 24 Jan 2008, 09:20 PM.
    Chris Boss
    Computer Workshop
    Developer of "EZGUI"

  • #2
    Here is the actual Turtle Graphics macro language:

    The document is an RTF file which can be read in Wordpad.

    The drawing commands are simply a single (uppercase) letter (ie. L for Line draw) followed by parameters ending with the ; character.
    Chris Boss
    Computer Workshop
    Developer of "EZGUI"


    • #3
      To appreciate the value of vector drawing, I created a program which displayed a simple image and then used the same Turtle macro in two other controls, one 50% the original size, the other 25% the original size.

      I copied the images to a photo editing program.

      I then took the original size image, alone, and then using the photo editing program (Micrografx Picture Publisher 7) I resized it to 25%.

      Notice in this picture the difference between the Turtle control drawing the image at 25% and resizing a raster (bitmap) image to 25%.

      Chris Boss
      Computer Workshop
      Developer of "EZGUI"


      • #4
        Awesome news, Chris, and very fair price.


        • #5
          Hopefully theres more coming.

          Working on making my MCI control standalone.
          It makes MCI easier than ever and offers an EZGUI simplified MCI command set. Control can play movies, midi, wave files and CD audio.
          Also provides open/save file dialogs including video open file dialog (displays video in dialog when selected).
          Chris Boss
          Computer Workshop
          Developer of "EZGUI"


          • #6
            The Turtle Graphic control serves a number of purposes.

            It is not meant to be used as a high end raster image control, but it is for drawing line drawings which require being defined using vector coordinates, rather than bitmaps.

            The macro language allows you to easily convert vectors into real images.

            The file sizes of a Turtle macro are extremely small (you can save the macro as a text file).

            It could be used to create programs that design and display blueprints, machine drawings, etc.

            Because it can define a user defined viewport, you can use coordinates which are not pixels. For example, you could define a viewport of say 8500 x 1100 units (8.5 x 11 page using 1/100 inch units) and use coordinates based on that. The image though could be drawn and scaled in any size control and even the printer.

            Also some of the turtle macros are quite sophisticated, for example the L (line) macro. It can draw (and repeat) lines based on angles and length.

            Also since the Turtle Graphics engine is available outside of the control, you can use it as an adjunct to your drawing tools for the PB Graphic control as well as the printer.

            Lastly, the Turtle Graphic control uses the GDI, so it can be used on any version of Windows (95 to Vista).
            Last edited by Chris Boss; 26 Jan 2008, 09:02 AM.
            Chris Boss
            Computer Workshop
            Developer of "EZGUI"


            • #7
              Seeing that Patrice was having a little fun with my pictures above in his post, I figured I would download his PhotoComposer to test out GDI+'s ability to scale raster images which are line drawings.

              First, let me say that Photo Composer is an amazing product and everyone should seriously take a look at it.

              Now for my point about vector scaling versus raster scaling:

              Here is a Turtle Graphic image drawn by two controls of different sizes:

              Now I first took the Bigger image and loaded two copies of it into PhotoComposer. One is 100% size and the other was zoomed down close to the size of the small image above. Here is how it looked:

              Notice the distortion in the small image, particularly the hatched brush.

              Now I took the original small image (above at the top) and loaded two copies into PhotoComposer. One was 100% and the other zoomed up to increase its size (the editor only let me zoom so far).

              I was only able to zoom so far and already the pixelation begain (double pixel sizes). Imagine if the drawing was zoomed to a number of sizes larger than I did.

              The point is that vector drawing is totally different than raster drawing.

              It serves a totally different purpose , scalability.

              True the Turtle Graphics control does not yet have anti-aliasing, but it does not over pixelate like a raster program does.

              The Turtle Graphics control, true is not high end graphics, but it does not need to be for line drawings.

              This is not to criticise any raster program. It simply shows the purpose of a vector based graphic control is totally different than a raster based one. This is why vector based graphic programs like Corel Draw are so valuable to artists. They allow you to draw based on vector objects, but the final image can be scaled indefinitely with little distortion.

              Now of course, my Turtle Graphic control is a low end tool and not to be compared to something like Corel Draw, but it does serves a purpose and can be very useful in the right context.
              Last edited by Chris Boss; 26 Jan 2008, 10:13 AM.
              Chris Boss
              Computer Workshop
              Developer of "EZGUI"


              • #8
                Any reason why it is called Turtle Graphics...wasn't that a special graphic package a few years ago for programming...where this sounds like a wrapper for api to draw vector graphics. Does it use commands like the Turtle Graphics package or something?
                Mobile Solutions
                Sys Analyst and Development


                • #9
                  I have heard of Turtle Graphics since the days of the Atari 400 computer. Often a form of Turtle Graphics have been implimented in languages like LOGO and PILOT. Turtle Graphics usually are interpreted commands, meaning a parser reads the commands from a string and draws them.

                  Turtle Graphics (from my experience) simply refers to a simple macro language which draws line based drawings. Some versions use actual words like MOVE or PEN, while some can use their own sytnax.

                  I chose using single letters to represent the commands. This makes the turtle string size much smaller and they are faster to write manually.

                  Turtle Graphics are usually coordinate based (vectors) while also including drawing commands which use angles or rotation.
                  Chris Boss
                  Computer Workshop
                  Developer of "EZGUI"


                  • #10
                    Here is a Turtle Graphic image and its corresponding Turtle macro string.
                    Download the RTF file I noted in a post above which has the entire macro language in it to figure out what the commands do.

                    Here is the Turtle macro string which drew this image:
                    (I put each command on a separate line so it is easier to read, but this is not necessary for the macro strings you use)

                    Chris Boss
                    Computer Workshop
                    Developer of "EZGUI"


                    • #11
                      One of the most powerful of the macros is the line (L) command. It has multple syntaxes, but here is one for example:


                      This command starting from the current pen position (use M command to move pen) draws a line 100 units long , 90 degrees from the starting position, then repeats this 4 times adding 90 degrees each additional time.

                      It draws a square!
                      Chris Boss
                      Computer Workshop
                      Developer of "EZGUI"


                      • #12
                        One other comment about the term Turtle Graphics:

                        One of the differences between Turtle Graphics and other drawing methods, is that rather than draw an object simply by giving all its fixed coordinates (ie. a rectangle and alls its corners), Turtle Graphics often moves a pen position around and draws from position to position (for children the term Turtle was used to give them the idea that the drawing was following a Turtle moving around the screen.

                        The EZGUI Turtle Graphics goes a few steps further, with the A (animate) and Z (zone) commands, where you can modify commands within a zone based on a frame number (defined by the A command). This allows you to define a drawing and then animate it (change its location and size or angles, simply by changing the frame number).

                        The macro language looks very simple at first glance, but it is very powerful in defining images.
                        Chris Boss
                        Computer Workshop
                        Developer of "EZGUI"


                        • #13

                          Enable the PhotoComposer antialias mode, using "Use high quality display", then try again using the zooming track bar

                          Patrice Terrier
                          Addons: GDImage.DLL 32/64-bit (Graphic library), WinLIFT.DLL 32/64-bit (Skin Engine).


                          • #14

                            I did have it on the high quality setting.

                            When I zoom smaller, at times the image is not too bad and others it is poor (the hatch gets blurred) depending upon how small I make it. This is to be expected when using a raster based program.

                            Now when I enlarge an image, the normal pixelating occurs, which is to be expected when enlarging a line drawing. Photo images don't show pixelation as quick as a line drawing will, since there are slighter differences between neighbor pixels.

                            I am not saying that GDImage is poor by any means. I am just saying that there is a market for a low cost vector based image control, since it has the advantage of scaling to any size. This would be useful when drawing to a large area printer (ie. plotter) or a very large page (ie. 11 x 17 or larger).

                            My control is not for photo like images and fancy graphics.

                            It is for drawing vector based images based on a simple vector definition string. A good example would be if someone wanted to write a blue print program which can draw images scaled at any size. The keyword here is line drawings.

                            Also the control uses a simple macro language for drawing. You don't have to make multiple calls to some API functions. You simply pass a turtle graphic macro string and the image is drawn. This makes it easy to store complete images in files, to convert from other vector formats (ie. DXF) to the Turtle macros (you have to write a parser of course).

                            Also the controls engine can be used in concert with the PB Graphic control. The PB Graphic control is quite popular among PB'ers and the Turtle Graphics engine can draw into the PB Graphic controls DC with a single subroutine call.

                            Lastly, since the macro language allows you to use a viewport setting (define width and height of image in image units, not pixels), it can be used to draw real world layouts and be scaled to the PC screen. Imagine having a blue print which is for a layout for thousands of feet in area. The control can easily convert one coordinate system into another, simply by using a viewport.

                            Let's say I have an area of 10,000 feet by 10,000 feet. The coordinates for positions in that layout is in feet. Now if I want to draw that image onto a Turtle control which is 480 x 480 pixels (so you can't use the original coordinates as pixels), I simply define a wiewport like this:

                            V1, 10000,10000;

                            Now the coordinates in the macro string can be in units of feet for a very large area, while the control will convert all coordinates into local units internally before drawing. The control though will never let the width of a line get smaller than 1 pixels, so lines are never lost when converting from a large scale to a small one.

                            My Turtle control is for totally different purposes than your GDImage control, so I find the comparison of your control with mine (in your thread about your graphic control you used images from my post to demonstrate some point) a little distasteful.

                            Your graphic control is simply amazing for what it does!

                            My control is for a totally different purpose and market.
                            It wasn't meant to be "pretty" (meaning flashy graphics).
                            It is purely functional and well suited to its purpose.
                            Chris Boss
                            Computer Workshop
                            Developer of "EZGUI"


                            • #15
                              Originally posted by Chris Boss View Post
                              for children the term Turtle was used to give them the idea that the drawing was following a Turtle moving around the screen.
                              The turtle was more than an idea, it was a robotic device. It later became sort of virtualized on a screen. There's some information on this at the Logo Foundation at

                              Your use of the term is probably a little different than the way it was originally used but not greatly different. Early Basics had a draw command which seems like a very primitive version of what you're doing and is probably a more likely ancestor. But as soon as I saw the name Turtle Graphics Package I guessed what was meant by it, so I'd say it works.



                              • #16

                                (1) It is vector based, rather than raster based.
                                What is the precision of the coordinates for your vectors?

                                Can you enter single/double precision values?

                                The reason I ask these questions is if your control cannot handle these types of values then it would be of little use to me as a tool to create blueprints. For example, I would need the coordinates to handle precision to accommodate tens of miles with a tolerance to 1/100th of a foot.

                                I would think machine drawings would be problematic too as tolerances there often run to 1/10000 of an inch.


                                "When governments fear the people there is liberty. When people fear the government there is tyranny." - Thomas Jefferson


                                • #17
                                  The coordinates are integer numbers, but smaller units can be defined simply by using a viewport.

                                  For example, lets say you want to use units of 1/100 of an mile and the display area viewport is to represent 10 miles by 10 miles.

                                  Instead of a view port of 10 x 10, you could use a viewport of 1000 x 1000, each unit being 1/100 of a mile (100 units x 10 miles = 1000).
                                  Chris Boss
                                  Computer Workshop
                                  Developer of "EZGUI"


                                  • #18
                                    Originally posted by Chris Boss View Post
                                    ...but smaller units can be defined simply by using a viewport...
                                    An even more clever solution IMO, because otherwise (using floating point literals), you would have to define a control size of few miles big... AFAIK, there are no monitors that big.

                                    Chris, maybe im asking too much, but, besides whole drawing viewport, is thre a function for small area viewport? Like zoom? If not, would you put it in the wish list?

                                    BTW... i was going to purchase this control and i lost the special offer, i think its cool. I had to much things in my head at the time.


                                    • #19
                                      If anyone has EZGUI 3.0 (including the Developer version which is only for inhouse), EZGUI 4.0 Pro or EZGUI 4.0 Personal , they all come with basically the same Turtle graphic control (the class name is different, but the graphic engine is basically the same).
                                      Chris Boss
                                      Computer Workshop
                                      Developer of "EZGUI"


                                      • #20
                                        I should point out that the Turtle Graphic control is not a high end CAD control, so don't expect features associated with much more expensive tools.

                                        That said, one can do a lot with this control.

                                        It is great for 2D scalable graphics (line art). It could be used for a backend for a LOGO programming front end (you create a parser which converts to turtle commands). It can be used for scalable layouts (ie. a yard planner, house blueprint layout, etc.).

                                        It can be used in concert with the PB Graphic control to draw scalable line images anywhere on the graphic control (no control needed. You use the Turtle engine directly).
                                        Chris Boss
                                        Computer Workshop
                                        Developer of "EZGUI"