Announcement

Collapse
No announcement yet.

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

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Emil Menzel
    replied
    >> Early Basics had a draw command

    So does the latest version of PB-DOS and the command is DRAW and I wish that it were included in PBCC and PBWin also.

    Leave a comment:


  • Chris Boss
    replied
    Elias,

    The Turtle control is now on sale again!

    It is only $12.45 (US) (for the next few days).

    Leave a comment:


  • Chris Boss
    replied
    I didn't say it could be used for "all" situations.

    For those that can live with integer coordinates using a viewport, it will work fine. For those that can't of course it won't.

    Leave a comment:


  • John R. Heathcote
    replied
    Chris,

    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).
    From the stand point of retrieving information from the drawing this would NOT be acceptable as you would get a slightly different answer if your view port were defined as 23 X 47, you would end up with slightly differing floating point round off as your view port dimensions change.

    Normally in highway construction, for example, we deal with big numbers, state plane or UTM coordinates. For example we can easily have a coordinate of X=1234567.1234, Y=123456.1234. Add to this is the fact we need to have consistent access to these values independent of viewport dimension as sometimes values are also obtained directly from the drawing for construction purposes. The accepted way to do this is to store this big coordinate value in the drawing.

    I'm not trying to be difficult here, but to simply show that you may want to rethink your statement that this control can be used for blueprint and CNC purposes in all cases.

    Leave a comment:


  • Chris Boss
    replied
    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).

    Leave a comment:


  • Chris Boss
    replied
    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).

    Leave a comment:


  • Elias Montoya
    replied
    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.

    Leave a comment:


  • Chris Boss
    replied
    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).

    Leave a comment:


  • John R. Heathcote
    replied
    Chris,

    (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.

    Leave a comment:


  • Barry Marks
    replied
    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 http://el.media.mit.edu/logo-foundat...go/turtle.html

    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.

    Barry

    Leave a comment:


  • Chris Boss
    replied
    Patrice,

    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.

    Leave a comment:


  • Patrice Terrier
    replied
    --Chris

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

    ...

    Leave a comment:


  • Chris Boss
    replied
    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.

    Leave a comment:


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

    L100,90,90,4;

    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!

    Leave a comment:


  • Chris Boss
    replied
    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)

    Code:
    V1,602,322;
    U0;
    F0;
    P3;
    M10,10;
    L590,10;
    P10;
    W30;
    M20,40;
    L580,40;
    W4;
    P5;
    M10,70;
    L100,90,90,4;
    P6;
    M220,70;
    W20;
    L100,150,120,3;
    P1;
    W15;
    M320,70;
    L40,90,45,8;
    P3;
    W12;
    M500,100;
    L40,180,60,6;
    P1;
    W15;
    M10,210;
    L110,310;
    M110,210;
    L10,310;
    P9;
    W50;
    M200,210;
    L570,290;
    P13;
    L200,250;
    P14;
    L400,290;
    P2;
    W15;
    M530,200;
    L45,180,30,12,2;
    W3;
    M50,47;
    P1;
    L20,45,90,36,1;

    Leave a comment:


  • Chris Boss
    replied
    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.

    Leave a comment:


  • Roger Garstang
    replied
    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?

    Leave a comment:


  • Chris Boss
    replied
    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.

    Leave a comment:


  • Chris Boss
    replied
    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.

    Leave a comment:


  • Chris Boss
    replied
    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).

    Leave a comment:

Working...
X