NGpaint

sketches in NewsGroups postings



NGpaint is a very tiny drawing program on Windows. and it is free, of course.
It will be available for Linux, Mac etc soon (hopefully :-)

Its main / only purpose is for newsgroup postings.
Mails don't need it, they can be in HTML or have attachments.

Often a small drawing tells more than 1000 lines of text. But binaries can/may not be distributed on newsgroups.

NGpaint is dual purpose:

DOWNLOAD
NGpaint.ZIP has 151kB to download.
please download preliminary
Ver.7 below

Version history
1 first release
2 T(M;
3 polyline using [Ctrl] key
4 highlight from text cursor,  grid
filled rectangles and ellipses
.NGS file-extension (NewsGroupSketch)
F6 focus textwindow
5 F1 Help window (small)
supervise polyline (closed bracket)
supervise legend text (closing quote")
supervise total graphic text size (< 4kB)
6 ARC added  (90° in 4 quadrants)
Draw circles with center+radius [Ctrl]
Statusbar with size display in editwindow.
.

Preliminary version 7,      187kB .ZIP
Zoom, 
relative coordinates, 
3 legend text sizes, upwards.
.
 
reader PERL source code David Jordan Ver 3 (Sep-2-1999)   *)
to postscript converter PERL source code Mark Zenier
MSDOS reader 
! zip 30kB
Incl. Pascal source 
(TP 7)
Frederic
NGpaint on JAVA immediate html here
and download .ZIP
incl. DRAWing tool!
Josef Chmel Ver 1.0  Dec.8.1999
*) Thank you, David Jordan, to update your program corresponding to the NGpaint extensions.
                     Ver 3 is now aware of relative coordinates from NGpaint Ver 7.
 
NGpaint Windows  HELP  file
! Nghelp.zip 8 kB
By Frederic Nov-12.1999

how to use: see below

DISCLAIMER

This is an evaluation program only!
It is written with Delphi 2 for Windows 95 and Windows NT 4. I am looking for programmers to port it to other platforms.
Source code see below.
It is not optimized and not perfect. Canvas size is now fixed to 320x200 pixels.

It is no more and no less than a base for further discussions and suggestions.

.
PLEASE TELL ME WHAT YOU THINK OF THIS APPROACH

Will you use it?

Which enhancements do you think are "MUST DO" ?

Would you write a similar program for another OS 
                   and talk about some standardisation issues?

FUTURE  (FUNCTIONS I WILL ADD NEXT)
arcs (90° in all 4 quadrants) in Ver. 6 already implemented
variable text size (small/normal/big) in Ver 7 already implemented
variable canvas size

BUT I WANT TO KEEP IT SIMPLE

EXAMPLE
The examples are electronic circuit diagrams, but there is no
restriction to use NGpaint for engineering, architecture, even
to sketch a baroque angel...

L(1;0;20;50;20)
L(1;50;20;50;30)
R(2;E;40;30;60;90)
L(1;50;90;50;100)
L(1;50;100;30;120)
L(1;30;120;50;140)
L(1;50;140;50;160)
L(4;30;110;30;130)
L(4;40;160;60;160)
E(4;E;10;100;50;140)
L(1;30;120;0;120)
L(1;37;121;41;131)
L(1;41;131;34;127)
L(DT;70;30;70;90)
R(2;E;80;30;100;90)
R(2;E;90;90;90;120)
L(1;90;90;90;160)
L(1;90;30;90;20)
L(1;90;20;130;20)
L(3;80;160;100;160)
L(3;130;10;130;30)
L(3;130;10;150;20)
L(3;150;20;130;30)
L(3;150;10;150;30)
L(1;150;20;190;20)
L(1;170;20;170;80)
L(3;160;80;180;80)
L(3;170;80;160;100)
L(3;170;80;180;100)
L(3;160;100;180;100)
L(1;170;100;170;160)
L(3;160;160;180;160)
R(3;E;190;10;240;30)
L(1;240;20;310;20)
L(1;260;20;260;90)
L(1;260;100;260;160)
L(3;250;160;270;160)
L(3;250;90;270;90)
L(1;250;100;270;100)
T(M;131;45;"D1")
T(M;185;99;"D2")
T(M;201;23;"L1")
T(M;265;81;"C1")
T(M;103;37;"o")
T(M;27;37;"o")
T(M;12;97;"T1")

.
This .GIF was copied from NGpaint
to a Windows paint program
via clipboard.

Canvas size is fixed to
320x200 pixels.

Note:
the example text in the left
column is "old fashioned".
Connected lines can be
represented now as polylines,
which reduces the overall size.

L(2;60;70;60;110)
L(2;60;110;100;90)
L(2;60;70;100;90)
T(M;63;84;"-")
T(M;62;100;"+")
L(1;100;90;120;90)
L(2;150;40;150;80)
L(2;150;80;190;60)
L(2;190;60;150;40)
L(2;150;100;150;140)
L(2;150;140;190;120)
L(2;190;120;150;100)
L(1;150;70;120;70)
L(1;120;70;120;110)
L(1;120;110;150;110)
R(2;F;210;70;240;110)
T(M;215;83;"R")
T(M;215;105;"S")
T(M;225;103;"/Q")
L(1;191;121;223;121)
L(1;223;121;223;109)
L(1;190;60;220;60)
L(1;220;60;220;70)
L(1;110;90;110;50)
L(1;110;50;80;50)
L(1;70;50;50;50)
L(1;50;50;50;80)
L(1;50;80;60;80)
L(3;70;40;70;60)
L(3;80;40;80;60)
L(1;60;100;0;100)
T(M;2;94;"+7.5V")
L(1;50;80;50;160)
L(1;50;160;220;160)
L(1;250;160;270;160)
L(1;270;160;270;100)
L(1;270;100;240;100)
R(2;E;220;155;250;165)
L(1;150;130;140;130)
L(1;140;130;140;150)
L(3;130;150;150;150)
L(1;150;50;130;50)
L(1;130;50;130;20)
L(1;130;20;20;20)
T(M;21;17;"excitation voltage")
T(M;155;71;"+")
T(M;154;132;"+")
T(M;155;115;"-")
T(M;155;55;"-")
L(1;120;110;120;180)
L(1;120;180;140;180)
T(M;192;23;"(c) Franz Glaser")
T(M;220;185;"-> third comparator")
L(3;140;190;160;170)
L(3;160;170;180;190)
L(3;180;190;200;170)
L(3;200;170;220;190)
T(M;201;49;"supply: +15V")
T(M;141;94;"LM324")
T(M;248;90;"CMOS 40??")
T(M;221;151;"10K")
T(M;57;36;"33nF")
R(3;E;30;40;290;180)
R(3;E;70;110;100;130)
R(3;E;100;100;160;140)
R(3;E;160;110;190;130)
L(DT;110;100;110;140)
L(DT;120;100;120;140)
L(DT;130;100;130;140)
L(DT;140;100;140;140)
L(DT;150;100;150;140)
L(DD;180;10;180;160)
L(3;200;40;200;60;100;60;-->
    ...100;110;50;110;50;40)
L(DD;80;100;80;140)
L(DD;90;100;90;140)
L(2;175;20;175;40)
L(2;185;20;185;40)
R(1;F;160;60;200;70)
R(1;F;160;160;200;170)
L(2;200;30;200;10)
R(2;E;175;70;185;110)
R(2;E;175;130;185;160)
L(2;190;20;200;10;210;20)
L(DT;170;130;170;160)
L(DT;190;130;190;160)
T(M;220;30;"P")
T(M;100;160;"Load cell")
T(M;200;150;"spring")
T(M;210;70;"limit")
E(1;E;106;28;257;140)
R(1;E;9;83;122;134)
L(3;67;26;309;91)
T(M;40;45;"Danube")
T(M;14;176;"Map of Austria")
T(M;231;77;"O")
T(M;220;89;"Wien")
T(M;214;116;"o")
T(M;196;128;"Graz")
T(M;153;54;"o")
T(M;145;67;"Linz")
T(M;109;78;"o")
T(M;120;80;"Salzburg")
T(M;62;104;"o")
T(M;40;115;"Innsbruck")
T(M;11;88;"o")
T(M;12;79;"Bregenz")
T(M;175;38;"o")
T(M;147;25;"Vorderweissenbach")
T(M;240;100;"o")
T(M;230;110;"Eisenstadt")
T(M;170;138;"o")
T(M;150;150;"Klagenfurt")
E(3;E;40;30;160;150)
L(1;100;90;100;30)
L(1;100;90;50;120)
L(1;100;90;120;150)
L(1;100;90;150;120)
L(1;100;90;160;70)
L(1;100;90;110;30)
T(M;60;80;"P")
T(M;80;130;"M")
T(M;120;130;"AfA")
T(M;130;100;"S")
T(M;120;70;"A")
T(M;100;20;"G")
L(1;104;37;104;20)
T(M;170;30;"P=Personalaufwand")
T(M;170;50;"M=Rohmaterial")
T(M;170;70;"AfA=Abschreibungen")
T(M;170;90;"S=Steuern, Versich...")
T(M;170;110;"A=Energie, Rep...")
T(M;170;130;"G=Gewinn")
T(M;80;180;"Gewinn = Erlöse - Aufwände")
pie graph
This sketch was produced by co-working. It is NOT MY WORK except the 2 arcs in the balloon. :-)
mantschgerl.ngs
brain storming

USAGE

INSTALL:
unZIP NGpaint.ZIP into a new folder (for easy DEL)
install it into your START menu as usual with Windows.
You get 2 files: NGpaint.EXE and psmode.txt (the example text above)
HOW TO USE IT
1. Invoke NGpaint.EXE
 
2. Load psmode.ngs with [F3] 
    or with Menu File.
    This will open the TEXTwindow.
3. Press [F7] to draw the picture. 
    This will open the draw - window.
2. Menu File New
3. copy the mail text into the text 
    window. If only 1 sketch is on 
    the posting, you can copy+paste
    the whole mail.
4. Press [F7]
5. You can add lines, rectangles, circles and text.
    Switch between the text window and the draw window using
       Menu Window  or simply click on the window border.
       Use [F6] and [F7] to switch between windows.
6. If you made a mistake, then
    a) select the text window with [F6], erase the appropriate line
    b) press [F7] for redraw.


7. You can save the text of the edit window on a file. 
    It is a pure text file, can be opened with the Windows editor.
    But this is not the main application of NGpaint-
8. Copy to clipboard (in the textedit window):
    a Menu Edit SelectAll
    b Menu Edit Copy.   Paste it to your newsreaders textwindow.
9. Copy the Bitmap to the clipboard:
    While in the drawing window, Menu Edit Copy. Paste to a pixelpaint program.
[F1] Help is provided, but not with the standard Windows help. Instead a small textwindow is provided. You need not close it but can hide it simply with a mouse click besides the help form. With F1 you get it back to the foreground. The Help form can be placed outside the NGpaint mainform.
Use the clipboard to copy the text to the mail program or vice versa.
Use the clipboard to copy the image to a pixelpaint windows program.

Of course I know that there are more powerful programs available on the market. AutoCAD can create a .DXF file which is standardized. But all have TOO MANY features and produce TOO MUCH TEXT for a newsgroup posting.
 

About the simplicity
Of course NGpaint is not a full fledged drawing program (besides it is a evaluation version only).

When you painted a line or rectangle, the coordinates are written into the textfile immediately at the bottom. This made it very easy for me to program. On the other hand, it would be necessary to scan the whole text if the user wants to erase a line in the image window to erase the text line too. This is simply too complicated for me hobby Delphi programmer...

I did it this way: switch to the text window and erase the line, then [F7] = redraw from text.

Another idea was the use of templates or blocks. But how? 

Either I define diodes and transistors and logical gates in the NGpaint program, and make D( or G( or whatever new lines. How many symbols should I define?

Or I have the high tech choice: let the user define templates. This would make the text almost undreadable, each line would get more complicated. What if a symbol is part of another - deep structure like with nested procedures.

My thought behind was: it should be even possible to draw on paper manually, simply reading the text.

If there are better programmers to do that, OK from me. But I BEG FOR SIMPLICITY, especially regarding the text.

I really would appreciate to keep the idea SIMPLE and EASY. It is not a drawing program, but a sketch utility for a particular purpose.

Yes, I will try to add a ZOOM, together with the approach of the variable canvas size. In the moment I am proud of the snap feature...

This paragraphs are not written to blame the friendly people who mailed me their ideas. Please understand that I am not a professional graphics programmer and not a professional Windows programmer. I found the idea brilliant to add the lines to the text simply when the mouse button is released. No OOPs, no hidden list of objects which are converted to a readable textfile upon close like AutoCAD does. I like the idea to switch between the text- and the painting window when drawing.

And I like the idea that it should work with plain DOS as well. No 16 Mio colors, no trillions of shades and hidden lines etc. No .GIF - file writing, no Move of areas, no filled areas.

  A SKETCH utility only, please!

WHAT I AM AFRAID OF:

That skilled programmers produce an overkill, extending and diversifying the notation standard. If there are experts who can define a SIMPLE and USABLE standard - PLEASE DO.
But PLEASE ONLY ONE - worldwide.
I appreciate serious discussions.

There is one further point of fear: The Unix people have another text file format with LF only for new line as opposed to DOS/Windows with CRLF.

Regards, Franz Glaser

There are some errors in NGpaint now. They will be corrected soon.
 

NGpaint is free.

It would be encouraged if programmers would make a companion program for other operating systems, Linux, Mac etc.

There are NO SECRETS in the NGpaint program.

It would not make much sense to make the Delphi source program public. The programming with Delphi cannot be ported to Linux or Mac anyway. And what the hell should it be good for to have more Windows implementations? And if a professional Windows programmer wants to make another Windows program, he/she surely will not need my source. And if he/she is a non - professional Windows - programmer like me, what should be the benefit for the community.

The "standard" can be viewed simply by looking on the text with some example drawings.
It is not worth to explain it. Only the text shall be standardized.

Until now only 4 distinct tools are defined: Line Rectangle Ellipse and Text.
Line can be extended to a polyline with additional XY pairs. 

On lines, rectangles and ellipses, the first number can be replaced with 

DS; DT; DD; for dashed, dotted, dashdot.
Non-solid lines are 1 pixel thick, so no thickness item must be saved
in the textline. This seems to be a Windows limitation.

Text will be enhanced to S M B for small/medium/big or so.??? No vertical
text, no mirrored text, no variable fonts. This is for sketches only.

Lines must start leftmost, and should not get appending text. Though
this is now unimportant except with the L( lines, it should be
treated as a standard for the future. But empty lines and lines,
that have no ( in column 2 are simply ignored.
NGpaint does NOT search the closing ). It reads as many items
as necessary for the tool and then ignores the rest of the line.
But polyLine will try to read more xy pairs until end of line.

I do not want to make global definitions in front of the drawing
text. Each tool has all the information it needs in the textline. No
nested constructions, all lines are interchangable. This contradicts
the definition of the canvas size also. I think that a sketch should fit
in the 320x200 pixels, that has few lines as to keep the mails short.

I will not introduce particular predefined symbols for a particular
application, like electrical circuit diagrams or mechanical parts
like nuts. The program should be usable in religious newsgroups
too to paint an angel (not very wise, I know, but you should
understand the point).

"Quis custodiet ipsos custodes?"
The net!   Detected on sci.physics from Uncle Al
 
Database specification (in development)
Disclaimer: it is not a database format,
because the text is only part of postings
in the usenet
Line L(t/s;X1;Y1;X2;Y2;X3;Y3...)
where
t/s = thickness or shape.
if t is a valid # between 1 and 10: solidline
else DS=dashed, DT=dotted, DD=dashdot
eg: L(DS;190;60;220;60)
I was not able to draw thick lines with dash, but I think that it is not necessary at all.
Rectangle R(t/s;f;X1;Y1;X2;Y2)
t/s = thickness or shape, see above
f: E=empty,  F=filled (black)
Ellipse E(t/s;f;X1;Y1;X2;Y2)
sane as R, where R is the surrounding rectangle of the ellipse.
No inclined ellipses are provided.
Ellipses can be painted with Center/Corner using the [Ctrl] key,
but they are represented here as topleft + bottomright corner
anyway. The order is not fixed.
Arc (new) A(t/s;0;Xc;Yc;X2;Y2);
Caution: the first XY coordinates are not the "opposite corner". The f  position is occupied, but unused. Future: If start and end angle will be defined, they will be appended behind Y2, similar to the polyline approach, in 0..355 degrees.
Text T(sz;X1;Y1;"text to write")
sz=size. Now only M is allowed but should be extended to SML for small, medium large. Can probably be extended to SU MU LU for vertical or ??? (upwards).

Idea: To allow for relative coordinates for X2andY2 etc. I am thinking of another 
delimiter symbol than the semicolon, eg. ;..;X1;Y1#X2#Y2
where X2 and Y2 can become negative values too. I think that the X1andY1
should be absolute for every element. So the whole rectangle... can be easily
replaced on the text editor window.

In the actual implemetation there is no fixing for the delimiter. The scanner does
not interpret the semicolon or the trailing closing bracket. It simply looks for
characters in 0..9 and A..Z, anything else is  a delimiter. This has to be extended
with the hyphen for negative relative coordinates, of course. Saying that the
semicolon is not standardized is only a half of the truth: NGpaint writes it, and
I would like to keep it except for special signalling, eg. the "relative" issue above.

The text string must be started and terminated with " but end of line works too.

What I plan to add: If the user is in the text window, the cursor on a line, 
the particular item shall be highlighted on the graphic. This idea comes from
my son and I treat it as very useful.   Already implemented in Version 4. Does not
work with "text", sorry.

NOTE: The definition is not really a DATABASE standard. It is plain text with
a special meaning, like a language. The file extension was fixed to .NGS for 
NewsGroupSketch, but there is no need to save the textfiles to disk, they are
part of the posting (maybe in the "SENT" folder).
PLEASE DO NOT QUOTE sketch paragraphs
graphwin_pas.txt
FOR REFERENCE ONLY, the Pascal / Delphi  unit that is the most interesting.
Note: this source is not from the latest version, but from Version 4. Mail me if you
need the full source.
INDEX Franz Glaser business URL

Sophisticated :-) Windows calculators for free download here:
one of the 5 calculators. click here free download:
5 different
Windows
calculators +
spreadsheet

Copyright © 1999 Franz Glaser, Vorderweissenbach, Austria ported from Geocities to www.meg-glaser.at/geo/
The CopyRight is valid for this page, not for the NGpaint.EXE program.