// doc division
The
tag recognizes these attributes, the values are parsed, pushed onto
a table stack, and restored after a
tag.
BORDER=
WIDTH=
CELLSPACING=
ALIGN=
BGCOLOR=
----------------------------------------------------------------------------
Thu, 29 June 2006
WINDOWSTYLE HIDDEN support removed, it was based on false assumptions
made based on article that talked about creating windows with no
taskbar text requiring a hidden parent. All that is false (and led me
to waste a HUGE amount of time debugging what would never work!).
WINDOWSTYLE with all the EX styles now work, they NEVER did in the past
not in GLPRO, nor in AfterGRASP. My entire understanding of how the
extended window attributes are set was completely incorrect. Fixed!
This includes the TOOLWINDOW setting, which you can see functioning
correctly with this small example:
windowstyle popup
drawclear white
set texthtml on
textln "A Window"
delay 200
textln "Changed to TOOLWINDOW"
windowshowstyle hide
windowstyle TOOLWINDOW
windowshowstyle show
wait
exitnow
----------------------------------------------------------------------------
Tue, 27 June 2006
JPEG support replaced with code from libjpeg-6c provided by Guido
Vollbeding of the JPEG Club.
http://jpegclub.org/libjpeg-6c.tar.gz
Message posted June 20th, 2006.
http://groups.google.com/group/comp.compression/msg/77d99c47ec1736da?hl=en&
The last updated to LIBJPEG (version 6b) was over 8 years ago!
The code which handles JPEG quality is rewritten to give far higher
quality results at the higher percentages. Saving an image near 100%
quality will now give results as good or better than Photoshop.
Here is the test script I used to watch for JPEG quality (it XOR's a
saved JPEG with an original, colored areas are mismatches):
windowsize 800 600 32
drawclear white
imageload original
timerset timecount
for i from 10 to 100
imageload original blah
filedelete blah.jpg
imagesavejpeg @i blah.jpg
imagefree blah
imageload blah
imageset blah
set drawxor on
imageput original
set drawxor off
imageset
imageput blah
imagefree blah
set texthtml on
text ""
color red
layer hah text @i
next
layer hah text @timecount
wait
exitnow
----------------------------------------------------------------------------
Tue, 20 June 2006
HTML Text that wraps on a
line now wraps under the previous text
not under the bullet.
So for example, in the past it did this:
0 this is some silly
text as an example.
It now wraps this way:
0 this is some silly
text as an example.
----------------------------------------------------------------------------
Mon, 19 June 2006
Bug in AGCOMP introduced on 14 June 2006 build which broke the compiling
of HEX constants is fixed.
messagebox 0x08000000 ; was displaying x08000000 - WRONG!
messagebox 0x08000000 ; Now displays 0x8000000
----------------------------------------------------------------------------
Thu, 15 June 2006
For HTMLTEXT, the bullet list support is rewritten fixing several serious
bugs in the display of bullet lists, and correcting the spacing. This
also streamlines some of the HTML parsing which was overly complicated
based on some incorrect assumptions. Here is the test script I used
where the output is very close to the same HTML shown in Internet
Explorer and FireFox.
windowsize 800 800
drawclear white
imagedensity 80
set texthtml on
text ""
text "one
one
one
- one
- two
- three
- four four four four four four four four four four four four four four four four four four four four four four four four four four four four four four
- five
a
b
zello
"
wait
exitnow
----------------------------------------------------------------------------
Wed, 14 June 2006
AGCOMP now treats numeric constants with leading or trailing zeros as
numbers not strings if they are not in quotes.
For instance:
messagebox "145.00000" ; displays 145.00000
messagebox 145.00000 ; displays 145.
messagebox 0000145.00000 ; displays 145.
messagebox "00000145" ; displays 00000145
messagebox 00000145 ; displays 145
----------------------------------------------------------------------------
Mon, 12 June 2006
New command STRHTMLTAGEXTRACT which will search through a string finding
all the matching tags, and return the matching attributes. It returns
multiple values, so you would commonly use functions like ARRAY or STRLIST
on the return values.
RESULTARRAY = ARRAY(STRHTMLTAGEXTRACT(HTMLSTRING,TAGNAME,ATTRIBNAME1,....))
RESULTARRAY = STRLIST(STRHTMLTAGEXTRACT(HTMLSTRING,TAGNAME,ATTRIBNAME1,....))
HTMLSTRING is the HTML text to search
TAGNAME is the TAG name to search for
ATTRIBUTENAME1 is the first attribute to extract
(multiple attributes are supported)
For example:
drawclear white
html get page "http://www.yahoo.com/index.htm"
messagebox strlist(strhtmltagextract(@page,font,face))
exitnow
Or:
windowsize 800 800
drawclear white
windowshowstyle shownormal
set teststring "uHello"
set texthtml on
text ""
set texthtml off
set textwrap off
text strlist(strhtmltagextract(@teststring, font, face, size))
wait
exitnow
New option for WINDOWSTYLE, HIDDEN. When the HIDDEN option is used, the
background window becomes a fixed 8 pixel by 8 pixel window that is always
hidden. Our main window is made a child of this window. This allows you
to create a window that is visible, but is not shown on the taskbar.
Unfortunately, it's not working yet, still under development.
The bullet tables with HTML TEXT now use different
symbols for different levels of indent:
Disc (first level of indent):
l
Circle (second level of ident):
¡
Square (3rd and all higher levels of ident):
n
Text inside
tags now have the tab size forced to the standard
8 spaces wide.
----------------------------------------------------------------------------
Thu, 08 June 2006
Replaced SOUND loading code with same base code as used for IMAGES and
other files.
SOUNDPLAY was sometimes not playing any more sounds until program exit.
Fixed.
SOUNDSTOP was unreliable, fixed.
----------------------------------------------------------------------------
Wed, 07 June 2006
WINDOWSTYLE CHILD now actually sets the style to CHILD (previously it
would just use POPUP). But this actually crashes right now because there
is no window to be a child of! (yet).
New system variable @WINSTYLE, is the integer version of a window
style set with the WINDOWSTYLE command.
----------------------------------------------------------------------------
Tue, 06 June 2006
SET TEXTFROMSKIP changed to NOT strip leading spaces or tabs. It now only
strips extra linefeeds.
Bug in STRCAT (the '$' operator) was throwing away trailing zeros on
strings that were valid floating point numbers. For instance:
textln "50."$"0000"
Was displaying "50." instead of the expected "50.0000".
This bug also affected the INC and DEC commands when used with HEX values
(was not working correctly).
----------------------------------------------------------------------------
Mon, 05 June 2006
The default character set for FONTSTYLE INIT and with no character set
ever set with FONTSTYLE is now DEFAULT (used to be ANSI).
This allows symbol fonts to work without setting the character set to
SYMBOL. For example, this test now works:
drawclear white
set texthtml on
text "
u"
wait
exitnow
----------------------------------------------------------------------------
Sun, 04 June 2006
The DRAWDENSITY command has been removed, same functionality is provided
by IMAGEDENSITY with no image specified.
IMAGEDENSITY command with no images specified sets.the current system
density (dots per inch).
IMAGEDENSITY XYSIZE
IMAGEDENSITY XSIZE YSIZE
IMAGEDENSITY XYSIZE IMAGEBUF [IMAGEBUF ...]
IMAGEDENSITY XSIZE YSIZE IMAGEBUF [IMAGEBUF ...]
Memory corruption bug in STREVAL (overwriting one byte beyond end of a
temporary buffer) fixed.
Memory read error in STRLIST which could try to read memory that was
previously free'd (and could have changed value) is fixed.
Serious memory leak in STRREPLACE fixed. Also STRREPLACE when using
10 or fewer pairs of search/replace values on short strings has dramaticly
less overhead (runs faster).
----------------------------------------------------------------------------
Thu, 01 June 2006
Bug in TEXTHEIGHT which ignored the last character in a string is fixed.
Bug in TEXT/TEXTLN which did not correctly take the rightoffset for each
character into account when wrapping is fixed.
Two new commands LOCALDEPTH and LOCALDEPTHS, function much like
LOCALUNDER and LOCALUNDERS. They allow you to create local variables at
a lower depth in the call tree.
LOCALDEPTH DEPTH VARNAME VALUE [VARNAME VALUE] [VARNAME VALUE] ...
LOCALDEPTHS DEPTH VARNAME [VARNAME] [VARNAME] ... VALUE [VALUE] [VALUE] ...
LOCALDEPTH 0 VARNAME VALUE
is identical to
LOCAL VARNAME VALUE
LOCALDEPTH 1 VARNAME VALUE
is identical to
LOCALUNDER VARNAME VALUE
----------------------------------------------------------------------------
Wed, 31 May 2006
STREVAL now handles strings in quotes as well a escaped quotes ("\"")
Here is a complex example:
sfontsize = 40
global pdate streval("strcat(\"
Prepared Date: \",strright(@date,2),\"/\",strmid(@date,5,2),\"/\",strmid(@date,3,2),\"\")")
Previously, the '$' operator (which concatinated two strings) passed the
two strings to the STRCAT function in reverse. In order to make STRCAT
easier to use on it's own. The compiler (AGCOMP) is changed to reverse
that, passing the parameters in the same order a human being would use.
The STRCAT command is updated to concatinate multiple strings in
the expected order, so:
messagebox strcat(a,b,c,d,e)
Displays "abcde". (previously it would have displayed "edcba").
This means any GL or EXE compiled before this build of AfterGRASP will
not run correctly if used with this or later runtimes (strings will
be concatinated in backwards order).
----------------------------------------------------------------------------
Wed, 17 May 2006 (Update)
The updated list of what STRHTMLTOFLASH does is as follows:
1. Strip CRLFs and tabs (replace with spaces)
2. Strip excess spaces and leading spaces
3. Replaces with space
4. Replace all &name; with asciicode;
5. Removes all
6. Replaces all
with
7. Replaces all
with
8. Replaces all
with
9. Replaces all
... with
...
10. Encodes all characters above 127 or below 32 using asciicode;
11. Replaces all " " with " " (works around a bug
in FLASH handling of bold tag that crosses a link).
12. Replaces all long hyphens '–' with short hypens '-'.
----------------------------------------------------------------------------
Wed, 17 May 2006 (Update)
Bug in STRHTMLTOFLASH and STRHTMLSTRIP reversing it's handling of leading
spaces on a line (was not stripping them, and was instead stripping them
from in front of all other tags). Fixed.
STRHTMLTOFLASH and STRHTMLSTRIP now treat as a space.
STRHTMLTOFLASH now encodes ASCII characters above 127, and below 32
using asciicode;.
The updated list of what STRHTMLTOFLASH does is as follows:
1. Strip CRLFs and tabs (replace with spaces)
2. Strip excess spaces and leading spaces
3. Replaces with space
4. Replace all &name; with asciicode;
5. Removes all
6. Replaces all
with
7. Replaces all
with
8. Replaces all
with
9. Replaces all
... with
...
10. Encodes all characters above 127 or below 32 using asciicode;
11. Replaces all " " with " " (works around a bug
in FLASH handling of bold tag that crosses a link).
----------------------------------------------------------------------------
Wed, 17 May 2006
AGEDIT updated to put quotes around the filenames with path it passes to the
AG Compiler (AGCOMP.EXE). This should correct the problems some were
having using directories with spaces in them.
STRHTMLSTRIP and STRHTMLTOFLASH now strip out CRLF, and excess spaces
(correctly).
STRHTMLTOFLASH extensively rewritten so that it now does this:
1. Strip CRLFs and tabs (replace with spaces)
2. Strip excess spaces and leading spaces
3. Strips
4. Replace all &name; with asciicode;
5. Removes all
6. Replaces all
with
7. Replaces all
with
8. Replaces all
with
9. Replaces all
... with
...
----------------------------------------------------------------------------
Tue, 16 May 2006
STRSEARCHHTML and STRSEARCHREVERSEHTML command removed.
Instead, we have the new STRHTMLPOSITION and STRPOSITIONHTML commands.
HTMLPOS = STRHTMLPOSITION(HTMLSTRING, STRIPPEDPOS)
STRIPPEDPOS = STRPOSITIONHTML(HTMLSTRING, HTMLPOS)
STRHTMLPOSITION converts a stripped string position into a HTML string
position.
STRHTMLPOSITION converts a stripped string position into a HTML string
position.
For instance:
htmlstring = "The names John&Ed are two names"
stripped = strhtmlstrip(@htmlstring)
pos = strhtmlposition(@htmlstring, strsearch(@stripped, "John&Ed"))
----------------------------------------------------------------------------
Sun, 14 May 2006
Two new string commands STRSEARCHHTML and STRSEARCHREVERSEHTML, they
effectively do the search on the string after a STRHTMLSTRIP is done,
but returns the string position in the original HTML string. This
is useful for finding text in an complex HTML string.
Crashing bug in STREVAL when passed a NULL string is fixed.
Crashing bug in SET VARIABLES ON when using large array indexes is fixed.
New command IMAGEEXISTS, checks to see if an image is loaded into memory
or available for loading:
RESULT = IMAGEEXISTS(IMAGENAME)
IMAGEEXISTS can be passed more than one image name, and returns true
only if all the images exist. This is different from the FILEEXISTS command
which returns true if any of the files exist.
RESULT = IMAGEEXISTS(IMAGENAME1,IMAGENAME2,IMAGENAME3)
----------------------------------------------------------------------------
Wed, 10 May 2006
@NETCONNECTED was always returning 6 (leftover from before @NETCONNECTED
was supported).
When @NETCONNECTED fails, the WININET.DLL is now freed from memory
until the next internet command is used.
@NETCONNECTED now provides a value less than 0 for errors.
Possible values:
-1 for no internet DLLs
-2 for IsNetworkAlive failure
-3 for InternetGetConnectedState failure
0 for no connection
1 Modem connection
2 LAN connection
4 Proxy connection
5 Modem Proxy connection
6 LAN Proxy connection
The HTTP commands now zero HTTPERROR if there was no error (previously
any error code was left in HTTPERROR).
----------------------------------------------------------------------------
Tue, 09 May 2006
Three new string commands for dealing with URLs and Adobe FLASH strings.
STRURLENCODE
Translates all characters not letters or numbers (a..z A..Z and 0..9)
into %HH where HH is the two digit hex code. This includes control
characters like @CRLF.
For example:
STRURLENCODE("Hello There"$@crlf) becomes "Hello%20There%0D%0A".
STRURLDECODE
Translates all %HH where HH is a two digit hex code into ascii.
For example:
STRURLDECODE("Hello%20There") becomes "Hello There".
STRHTMLTOFLASH
Translates all &charname; sequences into asciicode;
Translates all "
" to "", and "" to "".
Translates all "
" to "", and "" to "".
Translates all "
" to "".
Translates all "
" to "" and "
" to "
".
Working example of all three:
drawclear white
color black
fontdefine arial
textln "strurlencode(\"Hello There\"$@crlf)"
textln strurlencode("Hello There"$@crlf)
textln
textln "strurldecode(\"Hello%20There\")"
textln strurldecode("Hello%20There")
textln
textln "strhtmltoflash(\"&
Test \")"
textln strhtmltoflash("&
Test ")
textln
textln "strurlencode(strhtmltoflash(\"&
Test £ \"))"
textln strurlencode(strhtmltoflash("&
Test £ "))
textln
wait
exitnow
STRHTMLSTRIP is now supported (was an empty stub). Untested.
All mouse/keyboard events are now ignored while a systray menu is
active. This avoids some odd errors when clicking inside a menu that
overlaps the main app window.
----------------------------------------------------------------------------
Fri, 05 May 2006
Bug in STRREPLACE which would give incorrect results (sometimes not
finding a string) if the string it was searching for started with
a character who's ascii value was greater than 127. Fixed.
----------------------------------------------------------------------------
Fri, 28 Apr 2006
Results of math with measurements is now cleaned up so that zero values
are removed. Like 2pct-2pct now gives 0 instead of 0pct, and 2in+0 now
gives 2in instead of "0+2in".
----------------------------------------------------------------------------
Thu, 27 Apr 2006
STRSORT with the numeric option "#" now skips any leading non-numeric
characters on strings being compared.
For example:
drawclear white
drawslist = strlist("draw10", "draw1", "draw11", "draw10.5", "draw0.2", "draw2", "draw1.2")
strsort drawslist
messagebox @drawslist "Sorted normally"
strsort "#" drawslist
messagebox @drawslist "Sorted numericly"
exitnow
----------------------------------------------------------------------------
Wed, 26 Apr 2006
New command SYSTRAYCLICK which controls what clicking with the left
mouse button, right mouse button, and double clicking on the
system tray icon (set with SYSTRAYICON command) does.
SYSTRAYCLICK LEFTLABEL
SYSTRAYCLICK LEFTLABEL RIGHTLABEL
SYSTRAYCLICK LEFTLABEL RIGHTLABEL DOUBLELABEL
If a blank label is used, then nothing is done for that type of
click.
If the label "menu" is used, then the menu created by the SYSTRAYMENU
is used.
Otherwise it's label that is gosub'd when that type of mouse click
occurs on the system tray icon.
TEXTSTRPOSITIONFROM was not reseting the X position at the start of
text to be written.
TEXTSTRPOSITIONFIT was off by 1 byte (was returning a base 0 result),
and was not handling word wrap correctly on the last line.
The INC and DEC commands now support measurements and percentages, both
in the variable being incremented or decremented, and in the value added
to the variable.
DRAWBOX and DRAWRECT when drawing to a printer no longer have rounded
corners, the corners are now squared (Window's default pen has always
been rounded, had to change some calls to use ExtCreatePen to create
a non-rounded pen). Corners on both are now correctly squared even
at high resolutions.
----------------------------------------------------------------------------
Mon, 24 Apr 2006
The return values from IMAGEPUT (which are the XPOS and YPOS where the image
was actually placed) are now corrected for DRAWOFFSET.
Two new commands ARRAYPAIR and ARRAYPAIRS.
ARRAYRESULT = ARRAYPAIR(ITEM1, ATTRIB1, ITEM2, ATTRIB2, ITEM3, ATTRIB3, ..., ...)
ARRAYRESULT = ARRAYPAIRS(ITEM1, ITEM2, ITEM3, ..., ATTRIB1, ATTRIB2, ATTRIB3, ...)
They function like ARRAY, creating a sequential array starting with
index 0 onward. But they take both values and attributes, so for instance:
MENUARRAY[0] = "About"
MENUARRAY{0} = labelshowabout
MENUARRAY[1] = "Speed"
MENUARRAY{1} = &SPEEDMENUARRAY
MENUARRAY[2] = "Exit"
MENUARRAY{2} = labelexitnow
Can now be written as:
MENUARRAY = ARRAYPAIR("About", labelshowabout, "Speed", &SPEEDMENUARRAY, "Exit", labelexitnow)
Or using ARRAYPAIRS like this:
MENUARRAY = ARRAYPAIRS("About", "Speed", "Exit", labelshowabout, &SPEEDMENUARRAY, labelexitnow)
SYSTRAYMENU now working, and has support for grayed and checked entries.
Grayed and checked use a prefix (which is not displayed) on the menu
text. "GRAY:" for grayed out, and "CHECK:" for checked. You can use
both at the same time if you like:
SPEEDMENUARRAY[0] = "1 Second"
SPEEDMENUARRAY{0} = label1sec
SPEEDMENUARRAY[1] = "CHECK:2 Seconds"
SPEEDMENUARRAY{1} = label2sec
SPEEDMENUARRAY[2] = "5 Seconds"
SPEEDMENUARRAY{2} = label5sec
SPEEDMENUARRAY[3] = "10 Seconds"
SPEEDMENUARRAY{3} = label10sec
SPEEDMENUARRAY[4] = "30 Seconds"
SPEEDMENUARRAY{4} = label30sec
SPEEDMENUARRAY[5] = "1 Minute"
SPEEDMENUARRAY{5} = label1min
SPEEDMENUARRAY[6] = "2 Minutes"
SPEEDMENUARRAY{6} = label2min
SPEEDMENUARRAY[7] = "5 Minutes"
SPEEDMENUARRAY{7} = label5min
SPEEDMENUARRAY[8] = "10 Minutes"
SPEEDMENUARRAY{8} = label10min
MENUARRAY = ARRAYPAIR("About", labelshowabout, "Speed", &SPEEDMENUARRAY, "Exit", labelexitnow)
----------------------------------------------------------------------------
Wed, 19 Apr 2006
Three new commands to support System Tay icons, SYSTRAYICON, SYSTRAYTIP
and SYSTRAYMENU. SYSTRAYMENU is not written yet (doesn't do anything).
SYSTRAYICON and SYSTRAYTIP both are tested and working.
SYSTRAYICON ICONFILENAME XHOTSPOT YHOTSPOT
SYSTRAYICON ICONFILENAME XHOTSPOT YHOTSPOT
SYSTRAYTIP TOOLTIPSTRING
SYSTRAYMENU MENUARRAY
Example:
SPEEDMENUARRAY[0] = "1 Second"
SPEEDMENUARRAY{0} = label1sec
SPEEDMENUARRAY[1] = "2 Seconds"
SPEEDMENUARRAY{1} = label2sec
SPEEDMENUARRAY[2] = "5 Seconds"
SPEEDMENUARRAY{2} = label5sec
SPEEDMENUARRAY[3] = "10 Seconds"
SPEEDMENUARRAY{3} = label10sec
SPEEDMENUARRAY[4] = "30 Seconds"
SPEEDMENUARRAY{4} = label30sec
SPEEDMENUARRAY[5] = "1 Minute"
SPEEDMENUARRAY{5} = label1min
SPEEDMENUARRAY[6] = "2 Minutes"
SPEEDMENUARRAY{6} = label2min
SPEEDMENUARRAY[7] = "5 Minutes"
SPEEDMENUARRAY{7} = label5min
SPEEDMENUARRAY[8] = "10 Minutes"
SPEEDMENUARRAY{8} = label10min
MENUARRAY[0] = "About"
MENUARRAY{0} = labelshowabout
MENUARRAY[1] = "Speed"
MENUARRAY{1} = &SPEEDMENUARRAY
MENUARRAY[2] = "Exit"
MENUARRAY{2} = labelexitnow
SYSTRAYTIP "AfterGRASP Example"
SYSTRAYMENU &MENUARRAY
WINDOWFORCETOP has a new option, NOTOPMOST, same as ON except it does
not make the window the absolute topmost window.
WINDOWFORCETOP ; same as ON
WINDOWFORCETOP ON
WINDOWFORCETOP OFF
WINDOWFORCETOP NOTOPMOST
WINFINDBYCLASS and WINFINTBYTITLE now support 2 more optional parameters:
RESULTHWND = WINFINDBYCLASS(CLASS)
RESULTHWND = WINFINDBYCLASS(CLASS)
RESULTHWND = WINFINDBYCLASS(CLASS,HWNDPARENT)
RESULTHWND = WINFINDBYCLASS(CLASS,HWNDPARENT,HWNDCHILDAFTER)
RESULTHWND = WINFINDBYCLASS(CLASS,HWNDPARENT,HWNDCHILDAFTER,TITLE)
RESULTHWND = WINFINDBYTITLE(TITLE)
RESULTHWND = WINFINDBYTITLE(TITLE,HWNDPARENT)
RESULTHWND = WINFINDBYTITLE(TITLE,HWNDPARENT,HWNDCHILDAFTER)
RESULTHWND = WINFINDBYTITLE(TITLE,HWNDPARENT,HWNDCHILDAFTER,CLASS)
HWNDPARENT
Handle to the parent window whose child windows are to be searched.
If hwndParent is NULL, the function uses the desktop window as the parent window.
The function searches among windows that are child windows of the desktop.
HWNDCHILDAFTER
Handle to a child window. The search begins with the next child window in the Z order.
The child window must be a direct child window of hwndParent, not just a descendant window.
If hwndChildAfter is NULL, the search begins with the first child window of hwndParent.
Example which reads the Windows Task Bar height:
drawclear white
dllsetup user32.dll dword "GetWindowRect" GetWindowRect hwnd farptr
memnew rect 16
GetWindowRect WinFindByClass("Button", WinFindByClass("Shell_TrayWnd")) @rect
taskbarheight = @desktopsizey-#rect[4]
messagebox "TaskBarHeight = "$@taskbarheight
wait
----------------------------------------------------------------------------
Thu, 13 Apr 2006
New command WINDOWPOSITIONSTYLE, controls what style attributed are
passed to Windows each time the WINDOWPOSITION command is used.
The default value is:
WINDOWPOSITIONSTYLE SHOWWINDOW NOZORDER NOCOPYBITS FRAMECHANGED HWNDTOP INVALIDATERECT
Possible options are:
ASYNCWINDOWPOS
DEFERERASE
DRAWFRAME
FRAMECHANGED
HIDEWINDOW
NOACTIVATE
NOCOPYBITS
NOMOVE
NOOWNERZORDER
NOREDRAW
NOREPOSITION
NOSENDCHANGING
NOSIZE
NOZORDER
SHOWWINDOW
HWNDTOP
HWNDBOTTOM
HWNDTOPMOST
HWNDNOTOPMOST
INVALIDATERECT
Some notes on these flags:
ASYNCWINDOWPOS
If the calling thread and the thread that owns the window are attached
to different input queues, the system posts the request to the thread
that owns the window. This prevents the calling thread from blocking
its execution while other threads process the request.
DEFERERASE
Prevents generation of the WM_SYNCPAINT message.
DRAWFRAME
Draws a frame (defined in the window's class description) around the window.
FRAMECHANGED
Applies new frame styles set using the SetWindowLong function. Sends
a WM_NCCALCSIZE message to the window, even if the window's size is not
being changed. If this flag is not specified, WM_NCCALCSIZE is sent only
when the window's size is being changed.
HIDEWINDOW
Hides the window.
NOACTIVATE
Does not activate the window. If this flag is not set, the window is
activated and moved to the top of either the topmost or non-topmost
group (depending on the setting of the hWndInsertAfter parameter).
NOCOPYBITS
Discards the entire contents of the client area. If this flag is not
specified, the valid contents of the client area are saved and copied
back into the client area after the window is sized or repositioned.
NOMOVE
Retains the current position (ignores X and Y parameters).
NOOWNERZORDER
Does not change the owner window's position in the Z order.
NOREDRAW
Does not redraw changes. If this flag is set, no repainting of any kind
occurs. This applies to the client area, the nonclient area (including
the title bar and scroll bars), and any part of the parent window
uncovered as a result of the window being moved. When this flag is
set, the application must explicitly invalidate or redraw any parts of
the window and parent window that need redrawing.
NOREPOSITION
Same as the NOOWNERZORDER flag.
NOSENDCHANGING
Prevents the window from receiving the WM_WINDOWPOSCHANGING message.
NOSIZE
Retains the current size (ignores the cx and cy parameters).
NOZORDER
Retains the current Z order (ignores the hWndInsertAfter parameter).
SHOWWINDOW
Displays the window.
HWNDBOTTOM
Places the window at the bottom of the Z order. If the hWnd parameter
identifies a topmost window, the window loses its topmost status and
is placed at the bottom of all other windows.
HWNDNOTOPMOST
Places the window above all non-topmost windows (that is, behind all
topmost windows). This flag has no effect if the window is already a
non-topmost window.
HWNDTOP
Places the window at the top of the Z order.
HWNDTOPMOST
Places the window above all non-topmost windows. The window maintains
its topmost position even when it is deactivated.
INVALIDATERECT
Forces a InvalidateRect API call before the SetWindowPosition to force
the screen to be updated.
----------------------------------------------------------------------------
Wed, 12 Apr 2006
FONTLOAD of AGF fonts was broken in the 06 Apr 2006 build. Fixed.
----------------------------------------------------------------------------
Mon, 10 Apr 2006
Long standing bug in HTML processing where tag was not entirely
reseting the HTML parser is fixed. This could cause odd errors when
using TEXTFROM to display sections of text where a tag pair crossed
the boundry of the end of a section. Fixed.
----------------------------------------------------------------------------
Thu, 06 Apr 2006
TEXTFIT and TEXTFROM commands removed (replaced with TEXTLINESFIT and
TEXTLINESFROM)
New set of commands (and documentation for TEXTLINES):
TEXTLINES
TEXTLINESFIT
TEXTLINESFROM
TEXTLINESHEIGHT
TEXTSTRPOSITIONFIT
TEXTSTRPOSITIONFROM
TEXTSTRPOSITIONHEIGHT
TEXTSTRPOSITIONLINES
LINES = TEXTLINES(TEXTSTRING)
LINES = TEXTLINES(TEXTSTRING, STARTLINE)
LINES = TEXTLINES(TEXTSTRING, STARTLINE, WIDTH)
LINES = TEXTLINES(TEXTSTRING, STARTLINE, WIDTH, HEIGHT)
LINES = TEXTLINESFIT(TEXTSTRING)
LINES = TEXTLINESFIT(TEXTSTRING, STARTLINE)
LINES = TEXTLINESFIT(TEXTSTRING, STARTLINE, WIDTH)
LINES = TEXTLINESFIT(TEXTSTRING, STARTLINE, WIDTH, HEIGHT)
TEXTLINESFROM TEXTSTRING STARTLINE
TEXTLINESFROM TEXTSTRING STARTLINE LINECOUNT
YPIXELS = TEXTLINESHEIGHT(TEXTSTRING, WIDTH, STARTLINE)
YPIXELS = TEXTLINESHEIGHT(TEXTSTRING, WIDTH, STARTLINE, LINECOUNT)
CHARPOS = TEXTSTRPOSITIONFIT(TEXTSTRING, WIDTH, HEIGHT, STARTSTRPOSITION)
CHARPOS = TEXTSTRPOSITIONFIT(TEXTSTRING, WIDTH, HEIGHT, STARTSTRPOSITION, ENDSTRPOSITION)
TEXTSTRPOSITIONFROM TEXTSTRING STARTSTRPOSITION
TEXTSTRPOSITIONFROM TEXTSTRING STARTSTRPOSITION ENDSTRPOSITION
YPIXELS = TEXTSTRPOSITIONHEIGHT(TEXTSTRING, WIDTH, STRPOSITION)
YPIXELS = TEXTSTRPOSITIONHEIGHT(TEXTSTRING, WIDTH, STRPOSITION, ENDSTRPOSITION)
LINES = TEXTSTRPOSITIONLINES(STR, WIDTH, HEIGHT, STRPOSITION)
LINES = TEXTSTRPOSITIONLINES(STR, WIDTH, HEIGHT, STRPOSITION, ENDSTRPOSITION)
HTML ASCII code support "NUMBER;" fixed, was broken for the last few
builds.
Limited Unicode support for HTML text has been added. ASCII codes above
255 are permitted for "NUMBER;". This is not supported for anti-aliased
text, or for fontdefine. It only works on WINFONT fonts. You still cannot
create a AGF font with more than 256 characters. This support works in
all text operations that support HTML text including textwidth,
textheight, textfrom and so on.
----------------------------------------------------------------------------
Fri, 24 Mar 2006
Extensive error checking added to all string functions to check for
possible null strings (could have caused CRASH errors).
Numerous small tweaks made to TEXTHEIGHT to make it match the exact height
of TEXT commands.
TEXTFROMSTRIP now applies to TEXTHEIGHT and TEXTLINES.
----------------------------------------------------------------------------
Thu, 23 Mar 2006
Bug in Modular compiler was never including the XML library if XML was
used.
Modular compiler now excludes TIFF library if no load or save TIFF is used,
PNG library is no load or save PNG are used, JPEG library is no load or
save JPEG is used, and XML library is no XML commands are used. This
doesn't actually reduce runtime size, but does slightly speed up
link time, and helps me to catch bugs.
Two calls in Direct NET code were referencing WSOCK32.DLL directly
which would have forced TCP/IP networking to be installed in order
to run AfterGRASP. Fixed.
----------------------------------------------------------------------------
Wed, 22 Mar 2006
Fixed a crashing bug (divide by zero) in scrollboxes. Had to do with
elevator position on a scroll box where the area below the text
(to be scrolled) was 0 pixels high.
More error checking added for opening NET: filenames, and NETOPEN.
NETREADCOUNT support written.
New command NETLOOKUP, takes a domain name and returns the IP address
as a string, four integers seperated by periods. If it fails it
returns a NULL string (blank).
----------------------------------------------------------------------------
Tue, 21 Mar 2006
FILECLOSE FILEREAD* FILEWRITE* and FILESEEK commands now accept a
variable name for a handle, for example:
fs = fileopen("test.txt")
result = fileread(fs)
fileclose fs
WHEN NETSERVE, NETREADREADY and NETCLOSED partially done, not working yet.
FILEREADLINE now supported (previous did nothing at all).
RESULT = FILEREADLINE(HANDLE)
FILEREAD now supports reading all remaining bytes and returning the
result as a string, and reading N number of bytes, also returning
the result as a string:
FILEREAD HANDLE BUFFERADDRESS BYTECOUNT
RESULT = FILEREAD(HANDLE)
RESULT = FILEREAD(HANDLE, BYTECOUNT)
NET:FILENAME is in and working, here is a runable example
that uses fileappend with a net:filename and fileread
with just the handle to read whatever data is available:
drawclear white
color green
textln "making connection"
set file fileappend("net:www.aftergrasp.com:80")
; set file netopen("www.aftergrasp.com", 80) ; same thing
textln "sending GET string"
color black
filewriteline file "GET /test.htm HTTP/1.0"
filewriteline file "Host: www.aftergrasp.com"
filewriteline file ""
set textwrap off
timerset start
contentlength = 0
while @start<10000
s = filereadline(file)
textln @s
if strlen(@s)==0 break
cl = "Content-Length: "
if strleft(@s, strlen(@cl))==@cl
contentlength = strleftright(@s, strlen(@cl))
endif
endloop
textln ""
color blue
text fileread(file, @contentlength)
color red
text "done"
fileclose file
wait
exitnow
FileOpen/FileAppend no longer check for GZIP compression when opening
FTP: HTTP: or NET: files (didn't make sense).
----------------------------------------------------------------------------
Fri, 17 Mar 2006
New function HTTPQUERYS, returns an array of all HTTPQUERY results.
RESULTARRAY = HTTPQUERY()
RESULTARRAY = HTTPQUERY(URL)
Runable example:
drawclear white
color black
url = "http://www.aftergrasp.com/test.htm"
fullstring = "URL = "$@url$@crlf$@crlf
http getvar @url test
query = httpquerys()
filedelete httpresults.txt
fileputvariables httpresults.txt query
filesendln httpresults.txt @@test
appshell open httpresults.txt
wait 100
exitnow
Results look like this:
query[ACCEPT_RANGES] = bytes
query[CONTENT_LENGTH] = 217
query[CONTENT_TYPE] = text/html
query[DATE] = "Tue, 14 Mar 2006 18:49:57 GMT"
query[ETAG] = """514c113-d9-440f023b"""
query[LAST_MODIFIED] = "Wed, 08 Mar 2006 16:11:39 GMT"
query[RAW_HEADERS] = "HTTP/1.1 200 OK"
query[RAW_HEADERS_CRLF] = "HTTP/1.1 200 OK
Date: Tue, 14 Mar 2006 18:49:57 GMT
Server: Apache
Last-Modified: Wed, 08 Mar 2006 16:11:39 GMT
ETag: ""514c113-d9-440f023b""
Accept-Ranges: bytes
Content-Length: 217
Content-Type: text/html
"
query[REQUEST_METHOD] = GET
query[SERVER] = Apache
query[STATUS_CODE] = 200
query[STATUS_TEXT] = OK
query[VERSION] = HTTP/1.1
Close to finalized syntax for new NET commands for direct TCP/IP networking,
not working yet (partially written):
Three new WHEN types, NETSERVE, NETREADREADY and NETCLOSED. The
The first parameter passed to the trigger subroutine for all three
of these new WHEN types is the handle for TCP/IP connection.
NETSERVE is triggered for each incoming connection on the given TCP/IP
port.
WHEN NETSERVE PORT
DECLARE HANDLE
...
ENDWHEN
NETREADREADY is triggered when N number of bytes are ready to be read
from the given TCP/IP connection associated with HANDLE. If the
COUNT option is given, it's the number of bytes to wait for until
triggering the WHEN. If not given, a count of 1 is assumed.
WHEN NETREADREADY HANDLE
DECLARE HANDLE
...
ENDWHEN
WHEN NETREADREADY HANDLE COUNT
DECLARE HANDLE
...
ENDWHEN
NETCLOSED is triggered when a TCP/IP connection is closed.
WHEN NETCLOSED HANDLE ; First parameter passed to subroutine is HANDLE
DECLARE HANDLE
...
ENDWHEN
Keep in mind that since an array index can be any type of value, you can
use a TCP/IP connection handle as an array index to store connection
specific information. For example:
when servesub netserve 80
declare handle
when closewhens[@handle] netclosed @handle
free closewhens[@handle] readwhens[@handle] filenames[@handle]
endwhen
global filenames[@handle] netreadline(@handle)
when readwhens[@handle] netreadready @handle
declare handle
filesend @filenames[@handle] netread(@handle)
endwhen
endwhen
All file oriented commands support direct network I/O, just prepend
the prefix "NET:" and the ":PORTNUM" after the address.
HANDLE = FILECREATE("NET:ADDRESS:PORTNUM")
HANDLE = FILEOPEN("NET:ADDRESS:PORTNUM")
HANDLE = FILEAPPEND("NET:ADDRESS:PORTNUM")
FILECLOSE HANDLE
HANDLE = NETOPEN(ADDRESS,PORTNUM) ; Opens outgoing connection for read/write
BYTECOUNT = NETREADCOUNT(HANDLE)
ADDRESS = NETADDRESS(HANDLE)
HANDLE->ACTIVE
NETREAD HANDLE BUFFERADDRESS COUNT
BYTECOUNT = NETWRITECOUNT(HANDLE)
WAITNET HANDLE
WAITNET HANDLE TIMEOUT
WAITNETCLOSE HANDLE
WAITNETCLOSE HANDLE TIMEOUT
----------------------------------------------------------------------------
Fri, 10 Mar 2006
STREVAL now supports these unirary operators:
! logical not
# memgetlong
$ str
% memgetword
* memgetbyte
- negate
+ positive
& variable reference
~ bitwise not
For example:
drawclear white
color black
textln streval("-!!@true") ; displays -1
wait
exitnow
STRLINE (and some other string functions) would accidently convert the
string "." into "0.", they thought "." was a valid number. Fixed.
Comparison of floating point numbers now returns an integer value.
For instance 10.5!=10.0 used to return "1.0", but now returns "1"
All system variables that expect integer values will now
accept "ON" (same as "1") and "OFF" (same as "0") when
passed those values as a string, or via STREVAL.
This is a complete list of all system variables that are
based on integer values. MANY are obscure unused 0 value
stubs to prevent errors when porting GLPRO scripts.
Many of those unused obscure variables are incorrectly
treated as integers (they really should be strings or
other special types).
@ANIMABORT
@APPUSESHELL32
@DATACOUNT
@DBSKIPDELETED
@DBUSEASCII
@DEBUGEXIT
@DEBUGMP3
@DEBUGNET
@DEBUGPROFILE
@DEBUGSYSTEMLIST
@DEBUGTRACK
@DEBUGWAV
@DESKTOPBITS
@DESKTOPBITSREAL
@DESKTOPSIZEX
@DESKTOPSIZEXREAL
@DESKTOPSIZEY
@DESKTOPSIZEYREAL
@EMAILBYTES
@EMAILCOUNT
@EMAILDNSERROR
@EMAILDNSSERVER
@EMAILDNSTIMEOUT
@EMAILERROR
@EMAILFROM
@EMAILMAILER
@EMAILPRIORITY
@EMAILPROXY
@EMAILREPLY
@EMAILTO
@ERRORCRITICAL
@ERRORLINE
@ERRORLOAD
@ERRORMESSAGE
@ERRORNUMBER
@ERRORSCRIPT
@ERRORSTACK
@ERRORTYPE
@FALSE
@FILEGZIP
@FILEINDEXOPEN
@FILEINDEXSAVE
@FILELONGNAME
@FILESHARE
@FLOATDEGREES
@FLOATDIGITS
@FLOATEUROPEAN
@FLOATROUND
@FONTNAME
@FONTSCANWIDTH
@FTPBYTES
@FTPCOUNT
@FTPERROR
@FTPPROXY
@GLHANDLE
@GLMERGEREVERSE
@GLNAMEPREV
@GLPROFOCUS
@GLPROMULTIPLE
@GLPROPLATFORM
@GLPROUSER
@GLPROWIN32
@HTTPBYTES
@HTTPCOUNT
@HTTPERROR
@HTTPPATH
@HTTPPROXY
@HTTPTEMPDIR
@IMAGECOMPRESSED
@IMAGEDITHER
@IMAGEEDGECOLOR
@IMAGEEDGEENABLED
@IMAGEEMFPERCENT
@IMAGEEMFTEXTWIDTHS
@IMAGEFADEBARSIZE
@IMAGEFASTSCALE
@IMAGEFLOATLAST
@IMAGELOADCMYK
@IMAGEPRELOAD
@IMAGETRANENABLED
@INIINTERNAL
@INPUTABORT
@INPUTBEGIN
@INPUTCHANGE
@INPUTFULLEXIT
@INPUTINSERT
@INPUTPASSWORD
@INPUTPOSITION
@INPUTRESTORE
@INPUTSTRING
@INPUTTIMEOUT
@INPUTWRAP
@KEYABORTDELAY
@KEYCLEAR
@KEYDOWNALT
@KEYDOWNCTRL
@KEYDOWNSHIFT
@KEYHOTDELAY
@KEYPRESSED
@KEYUPALT
@KEYUPCTRL
@KEYUPSHIFT
@LAYERHOTSPOT
@LAYERSEPARATE
@LAYERSKIPFRAMES
@LOOP
@MEMAVAILABLE
@MEMNEAR
@MEMUSED
@MOUSE
@MOUSEALWAYS
@MOUSEDOWN
@MOUSEDOWN1
@MOUSEDOWN2
@MOUSEDOWN3
@MOUSEDOWNX1
@MOUSEDOWNX2
@MOUSEKEY
@MOUSEMOVED
@MOUSEPRESSED
@MOUSEUP
@MOUSEUP1
@MOUSEUP2
@MOUSEUP3
@MOUSEUPX1
@MOUSEUPX2
@NETPROXYTYPE
@NETTIMEOUT
@NULL
@PALETTEACCURATE
@PALETTEEND
@PALETTEENDEXCLUDE
@PALETTEREMAP
@PALETTESTART
@PALETTESTARTEXCLUDE
@PRINTCMYK
@PRINTCOLORRES
@PRINTMETRIC
@PRINTPIXELSX
@PRINTPIXELSY
@PRINTRESX
@PRINTRESY
@PRINTSIZEX
@PRINTSIZEY
@SCRIPTBUFFER
@SCRIPTSIZE
@SOUNDBLOCKSIZE
@SOUNDCACHEBITS
@SOUNDCACHECHANNELS
@SOUNDCACHEHEAD
@SOUNDCACHERATE
@SOUNDCACHESIZE
@SOUNDCACHETAIL
@SOUNDCLOCK
@SOUNDDEVICE
@SOUNDELAPSED
@SOUNDLEVEL
@SOUNDLEVELLEFT
@SOUNDLEVELRIGHT
@SOUNDMIXLEADTIME
@SOUNDPLAYING
@SOUNDVOLUME
@SOUNDVOLUMELEFT
@SOUNDVOLUMERIGHT
@STACK
@SYSCPUMMX
@SYSCPUTYPE
@SYSCTRLALTDEL
@SYSDISKMAX
@SYSDPMS
@SYSESC
@SYSLOCKINPUT
@SYSMESSAGEDELAY
@SYSMESSAGESKIP
@SYSOS2
@SYSRUNBACK
@SYSSLEEP
@SYSSPACE
@SYSSWAPPATH
@SYSYIELD
@TRUE
@VIDEOBENCHMARK
@VIDEOSCALE
@VIDEOSCALEX
@VIDEOSCALEY
@WHENBACKGROUND
@WHENENABLED
@WHENFIRSTONLY
@WHENINSUB
@WHENLASTFIRST
@WHENOFFSCREEN
@WIN2000
@WIN31
@WIN32
@WIN32FILEACCESS
@WIN95
@WIN98
@WINBUILD
@WINDOWBACKPOSX
@WINDOWBACKPOSY
@WINDOWBACKSIZEX
@WINDOWBACKSIZEY
@WINDOWBITDEPTH
@WINDOWPOSX
@WINDOWPOSY
@WINDOWREFRESHRATE
@WINDOWSCALED
@WINDOWSCALEDX
@WINDOWSCALEDY
@WINDOWSIZEX
@WINDOWSIZEY
@WINFRAMEADR
@WINFRAMEDIB
@WINFRAMEDIBHDC
@WINFRAMEHDC
@WINFRAMEHDIB
@WINFRAMELEN
@WINHANDLE
@WININSTANCE
@WININSTANCEPREV
@WINNT
@WINSHOWSTYLE
@WINSYSTEMDIRECTORY
@WINVERSION
@WINYTOPORIGIN
----------------------------------------------------------------------------
Wed, 08 Mar 2006
TEXTKERN done before a
tag is now supported.
SET TEXTKERNSIZE when DRAWOFFSET is in use is fixed.
Dividing one measure by another of the same type is fixed, so
12in/4in is 3 (it was returning 3in).
Results of measure calculations that have no distance or percentage
component are now returned as a plain floating point number.
----------------------------------------------------------------------------
Tue, 07 Mar 2006
Typo in yesterday's build kept COLORMIX COLORSATURATIONSET COLORHUESET
and COLORBRIGHTNESSSET from being recognized as valid commands. Fixed.
Inaccurate results in COLORSATURATIONSET COLORHUESET and COLORBRIGHTNESSSET
fixed.
Conversion of metric measurements to text is fixed.
----------------------------------------------------------------------------
Mon, 06 Mar 2006
The Height in IMAGESIZE when using a percentage was incorrect since the
22 Feb 2006 build. Fixed.
Six new color functions/commands:
COLORRESULT = COLORMIX(PCT1,COLOR1,PCT2,COLOR2 ...)
COLORRESULT = COLORSATURATIONSET(PCTADDSUB, COLOR)
COLORRESULT = COLORBRIGHTNESSSET(PCTADDSUB, COLOR)
COLORRESULT = COLORHUESET(DEGREESADDSUB, COLOR)
NEARCOLOR = COLORNEAREST(COLOR, MATCHCOLOR1, MATCHCOLOR2 ...)
FARCOLOR = COLORFURTHEST(COLOR, MATCHCOLOR1, MATCHCOLOR2 ...)
COLORMIX mixes 2 or more colors (no limit on how many). For instance, these
lines all create a color that is 25% white, 50% black, and 25% blue:
color colormix(25,white,50,black,25,blue)
color colormix(1,white,2,black,1,blue)
color colormix(10,blue,10,0xffffff,20,0)
COLORSATURATIONSET adjusts the saturation in a color by adding
or subtracting percentage count (-100 to +100).
COLORBRIGHTNESSSET adjusts the brightness of a color by adding
or subtracting percentage count (-100 to +100).
COLORHUESET adjusts a color's hue by adding or subtracting an angle
in degrees (-360 to +360).
COLORNEAREST returns which match color is closest to the color passed.
For instance:
color colornearest("127,64,0", black, white) ; would return 0 (black)
COLORFURTHEST returns which match color is furthest to the color passed.
For instance:
color colorfurthest("127,64,0", black, white, red) ; would return 0xffffff (white)
STREVAL now handles function calls, for example:
textln streval("max(1,2,3,4,abs(-5))") ; displays 5
New function/command used to get information on an HTTP connection:
RESULT = HTTPQUERY(QUERYTYPE)
RESULT = HTTPQUERY(QUERYTYPE, INDEX)
RESULT = HTTPQUERY(QUERYTYPE, INDEX, URL)
Query Types:
ACCEPT Retrieves the acceptable media types for the response.
ACCEPT_CHARSET Retrieves the acceptable character sets for the response.
ACCEPT_ENCODING Retrieves the acceptable content-coding values for the
response.
ACCEPT_LANGUAGE Retrieves the acceptable natural languages for the response.
ACCEPT_RANGES Retrieves the types of range requests that are accepted for a
resource.
AGE Retrieves the Age response-header field, which contains the
sender's estimate of the amount of time since the response
was generated at the origin server.
ALLOW Receives the methods supported by the server.
AUTHORIZATION Retrieves the authorization credentials used for a request.
CACHE_CONTROL Retrieves the cache control directives.
CONNECTION Retrieves any options that are specified for a particular
connection and must not be communicated by proxies over
further connections.
COOKIE Retrieves any cookies associated with the request.
CONTENT_BASE Retrieves the base URI for resolving relative URLs within the
entity.
CONTENT_ENCODING Receives any additional content codings that have been applied
to the entire resource.
CONTENT_ID Receives the content identification.
CONTENT_LANGUAGE Receives the language that the content is in.
CONTENT_LENGTH Receives the size of the resource, in bytes.
CONTENT_LOCATION Retrieves the resource location for the entity enclosed in the
message.
CONTENT_MD5 Retrieves a MD5 digest of the entity-body for the purpose of
providing an end-to-end message integrity check (MIC) for the
entity-body.
CONTENT_RANGE Retrieves the location in the full entity-body where the
partial entity-body should be inserted and the total size of
the full entity-body.
CONTENT_TRANSFER_ENCODING Receives the additional content coding that has been applied
to the resource.
CONTENT_TYPE Receives the content type of the resource (such as text/html).
DATE Receives the date and time at which the message was
originated.
ETAG Retrieves the entity tag for the associated entity.
EXPIRES Receives the date and time after which the resource should be
considered outdated.
FROM Retrieves the e-mail address for the human user who controls
the requesting user agent if the From header is given.
HOST Retrieves the Internet host and port number of the resource
being requested.
IF_MATCH Retrieves the contents of the If-Match request-header field.
IF_MODIFIED_SINCE Retrieves the contents of the If-Modified-Since header.
IF_NONE_MATCH Retrieves the contents of the If-None-Match request-header
field.
IF_RANGE Retrieves the contents of the If-Range request-header field.
This header allows the client application to check if the
entity related to a partial copy of the entity in the client
application's cache has not been updated. If the entity has
not been updated, send the parts that the client application
is missing. If the entity has been updated, send the entire
updated entity.
IF_UNMODIFIED_SINCE Retrieves the contents of the If-Unmodified-Since request-
header field.
LAST_MODIFIED Receives the date and time at which the server believes the
resource was last modified.
LOCATION Retrieves the absolute URI used in a Location response-header.
MAX Retrieves the maximum value of an HTTP_QUERY_* value.
MAX_FORWARDS Retrieves the number of proxies or gateways that can forward
the request to the next inbound server.
MIME_VERSION Receives the version of the MIME protocol that was used to
construct the message.
PRAGMA Receives the implementation-specific directives that may apply
to any recipient along the request/response chain.
PROXY_AUTHENTICATE Retrieves the authentication scheme and realm returned by the
proxy.
PROXY_AUTHORIZATION Retrieves the header that is used to identify the user to a
proxy that requires authentication.
PUBLIC Receives methods available at this server.
RANGE Retrieves the byte range of an entity.
RAW_HEADERS Receives all the headers returned by the server. Each header
is terminated by "\0". An additional "\0" terminates the list
of headers.
RAW_HEADERS_CRLF Receives all the headers returned by the server. Each header
is separated by a carriage return/line feed (CR/LF) sequence.
REFERER Receives the URI of the resource where the requested URI was
obtained.
REQUEST_METHOD Receives the verb that is being used in the request, typically
GET or POST.
RETRY_AFTER Retrieves the amount of time the service is expected to be
unavailable.
SERVER Retrieves information about the software used by the origin
server to handle the request.
SET_COOKIE Receives the value of the cookie set for the request.
STATUS_CODE Receives the status code returned by the server.
STATUS_TEXT Receives any additional text returned by the server on the
response line.
TRANSFER_ENCODING Retrieves the type of transformation that has been applied to
the message body so it can be safely transferred between the
sender and recipient.
UPGRADE Retrieves the additional communication protocols that are
supported by the server.
URI Receives some or all of the Uniform Resource Identifiers
(URIs) by which the Request-URI resource can be identified.
USER_AGENT Retrieves information about the user agent that made the
request.
VARY Retrieves the header that indicates that the entity was
selected from a number of available representations of the
response using server-driven negotiation.
VERSION Receives the last response code returned by the server.
VIA Retrieves the intermediate protocols and recipients between
the user agent and the server on requests, and between the
origin server and the client on responses.
WARNING Retrieves additional information about the status of a
response that may not be reflected by the response status
code.
WWW_AUTHENTICATE Retrieves the authentication scheme and realm returned by the
server.
Here is a working example of HTTPQUERY:
drawclear white
color black
list = array(
ACCEPT,
ACCEPT_CHARSET,
ACCEPT_ENCODING,
ACCEPT_LANGUAGE,
ACCEPT_RANGES,
AGE,
ALLOW,
AUTHORIZATION,
CACHE_CONTROL,
CONNECTION,
COOKIE,
CONTENT_BASE,
CONTENT_ENCODING,
CONTENT_ID,
CONTENT_LANGUAGE,
CONTENT_LENGTH,
CONTENT_LOCATION,
CONTENT_MD5,
CONTENT_RANGE,
CONTENT_TRANSFER_ENCODING,
CONTENT_TYPE,
DATE,
ETAG,
EXPIRES,
FROM,
HOST,
IF_MATCH,
IF_MODIFIED_SINCE,
IF_NONE_MATCH,
IF_RANGE,
IF_UNMODIFIED_SINCE,
LAST_MODIFIED,
LOCATION,
MAX,
MAX_FORWARDS,
MIME_VERSION,
PRAGMA,
PROXY_AUTHENTICATE,
PROXY_AUTHORIZATION,
PUBLIC,
RANGE,
REFERER,
REQUEST_METHOD,
RETRY_AFTER,
SERVER,
SET_COOKIE,
STATUS_CODE,
STATUS_TEXT,
TRANSFER_ENCODING,
UPGRADE,
URI,
USER_AGENT,
VARY,
VERSION,
VIA,
WARNING,
WWW_AUTHENTICATE)
url = "http://www.aftergrasp.com"
fullstring = "URL = "$@url$@crlf$@crlf
http getvar @url test
for item in strlist(@list)
result = httpquery(@item)
if strlen(@result)
textln @item$" = "$@result
fullstring = @fullstring$@item$" = "$@result$@crlf
endif
next
filedelete httpresults.txt
filesendln httpresults.txt @fullstring
appshell open httpresults.txt
wait 100
exitnow
***NOT WRITTEN YET*** New NET commands for direct TCP/IP networking:
WHEN NETSERVE port
@NETHANDLES
@NETHANDLE
HANDLE = NETOPEN(address,port)
NETCLOSE HANDLE
NETREAD HANDLE BUFFERADDRESS COUNT
RESULT = NETREADBYTE(HANDLE)
RESULT = NETREADWORD(HANDLE)
RESULT = NETREADLONG(HANDLE)
RESULT = NETREADFLOAT(HANDLE)
RESULT = NETREADLINE(HANDLE)
NETWRITE HANDLE BUFFERADDRESSS COUNT
NETWRITEBYTE HANDLE BYTEVAL
NETWRITEFLOAT HANDLE FLOATVAL
NETWRITELINE HANDLE STRING
NETWRITELONG HANDLE LONGVAL
NETWRITEWORD HANDLE WORDVAL
NETWAIT TIMEOUT
NETWAITCLOSE TIMEOUT
RESULT = NETACTIVE(HANDLE)
----------------------------------------------------------------------------
Fri, 03 Mar 2006
Constant used to calculate metric distances was slightly off (about 0.01%),
corrected to be 5000/127 inches per meter.
The variable not found error now displays the variable name.
The COLORGET command when passed no coordinates now returns the color read
from pixel location (0,0) instead of just returning color 0.
New command, IMAGECOLORGET, first parameter is an image buffer, the parameters
which follow are identical to the COLORGET command:
COLORRESULT = IMAGECOLORGET(IMAGEBUF)
COLORRESULT = IMAGECOLORGET(IMAGEBUF,XPOS,YPOS)
IMAGECOLORGET IMAGEBUF VARNAME
IMAGECOLORGET IMAGEBUF XPOS YPOS VARNAME
IMAGECOLORGET IMAGEBUF XPOS YPOS RVARNAME GVARNAME BVARNAME
----------------------------------------------------------------------------
Thu, 02 Mar 2006 PM
All commands that accept colors will now accept a single string of 3
decimal numbers seperated by spaces or commas as a RGB color value.
Like this:
set colornum "128,0,128"
color "255 255 0"
New command VARSYSTEM, returns true if a variable is a system variable.
If passed more than 1 parameter, then the system variable is set.
For example:
varsystem colornum black
if varsystem(colornum)
text "ColorNum is a system variable"
endif
set varname colornum
set value 0
if !varsystem(@varname,@value)
set @varname @value
endif
The STREVAL function now handles system variables, for instance:
color 127
textln streval("@colornum") ; displays 127
----------------------------------------------------------------------------
Thu, 02 Mar 2006
DRAWOFFSET with no parameters was not restoring the previous draw offset,
it was reseting back to the original draw offset (like DRAWOFFSETRESET).
Fixed.
DRAWOFFSET with just two parameters now shifts the draw offset area,
instead of shrinking it.
DRAWOFFSET allows you to create a draw offset that is outside the bounds of
the window. It does not bounds checking.
----------------------------------------------------------------------------
Tue, 28 Feb 2006
Debug VARIABLES ON display of measurements that include a percentage was
broken. Fixed.
Four new system variables DRAWWIDTH DRAWHEIGHT DRAWOFFWIDTH and DRAWOFFHEIGHT
@DRAWWIDTH is the same as 1+@DRAWMAXX-@DRAWMINX
@DRAWHEIGHT is the same as 1+@DRAWMAXY-@DRAWMINY
@DRAWOFFWIDTH is the same as 1+@DRAWOFFMAXX-@DRAWOFFMINX
@DRAWOFFHEIGHT is the same as 1+@DRAWOFFMAXY-@DRAWOFFMINY
New command IMAGESIZEFIT, same exact syntax as IMAGESIZE except it will
size an image so that it fits within the given size without distorting,
maintaining the original aspect ratio.
All these variables and commands which accepted "ON" and "OFF" are fixed
to allow those strings even when passed in a variable or via the WITH
command.
@DRAWAND
@DRAWOR
@DRAWXOR
@TEXTCENTER
@TEXTCLIP
@TEXTCOLORCODES
@TEXTDRAW
@TEXTDRAWBACK
@TEXTFONTCODES
@TEXTFROMSTRIP
@TEXTHTML
@TEXTHTMLANTIFONT
@TEXTHTMLTABS
@TEXTHTMLWINFONT
@TEXTINDENT
@TEXTJUSTIFIED
@TEXTLEFT
@TEXTMONOSPACE
@TEXTQUICK
@TEXTRIGHT
@TEXTRTF
@TEXTSCROLL
@TEXTWRAP
@TEXTWRAPPUNCT
DRAWFLOOD
For instance:
with texthtml on text @sometext
Now works as expected.
----------------------------------------------------------------------------
Fri, 24 Feb 2006
IMAGESIZE when used with DRAWOFFSET was broken, fixed.
----------------------------------------------------------------------------
Wed, 22 Feb 2006
DRAWBOX completely rewritten to be dramaticly faster for thicker widths.
In the past 4 x WIDTH number of filled rectangles were drawn for each
box. Now a maximum of 4 filled rectangles are drawn. Also for all bit
depths below 24bits per pixel, and for print devices a single windows
Rectangle() API call is used with a hollow brush.
DRAWBOXROUND DRAWRECTROUND were drawing images too small by one pixel
on the bottom and right sides.
DRAWRECT when used on a printer, or bit depths bellow 24 was drawing
images too small by a 1 or more pixels depending on the size of the
rectangle.
Runable test which showed the problems (and that they are fixed now):
windowsize 800 600 8
drawclear white
color 0
imagenew test 101 101
imageput 100 100 test
imageput 100 220 test
imageput 220 100 test
imageput 220 220 test
color yellow
drawbox 101 101 199 199
drawboxround 221 101 319 199
drawrect 101 221 199 319
drawrectround 221 221 319 319
wait
exitnow
----------------------------------------------------------------------------
Tue, 21 Feb 2006
New command, FILESTRREPLACE, used to replace strings in a file. Useful
for working with large files that would require a huge amount of memory
to process if you loaded them into memory as a string. Uses 64bit counts,
so it will handle files larger than 4GB, and will work with binary data.
FILESTRREPLACE SOURCEFILENAME DESTINATIONFILENAME STRA STRB ...
New commands TOSIZEX and TOSIZEY, go along with new operators,
(VALUE)SIZEX and (VALUE)SIZEY. Works primarily the same as
the existing TOSIZE command (VALUE)SIZE operator, except with
axis specific values, such as percentages. Example:
drawbox 100 100 (50pct)sizex (50pct)sizey
TOSIZE and (VALUE)SIZE were broken when used with a DRAWOFFSET, fixed.
----------------------------------------------------------------------------
Thu, 16 Feb 2006
topixelsx and topixelsy functions, and )pixelsx and )pixelsy operators are
fixed when used with a DRAWOFFSET (they now subtract @DRAWOFFMINX/@DRAWOFFMINY
from the pixel value).
Postscript image mask compressed was accidently disabled, it's re-enabled.
DRAWOFFSET changed so that it is relative to any previous draw offset.
DRAWOFFSET with no parameters now reverts to the previous draw offset.
The list of draw offsets is kept up to 16 deep.
New command DRAWOFFSETRESET, resets the draw offset to the maximum
(original image boundries). Also flushes any previous draw offsets.
It accepts the same parameters as DRAWOFFSET, so you can create a
new draw offset with a single command. This is very much like
the old behavior of the DRAWOFFSET command.
New system variables which are the bounds of the current draw offset:
@DRAWOFFMINX
@DRAWOFFMINY
@DRAWOFFMAXX
@DRAWOFFMAXY
----------------------------------------------------------------------------
Wed, 15 Feb 2006
INC/DEC with a string was corrupting any previous use of that string
(it was destroying the actual token's original value). Fixed.
STREVAL with no value or a NULL value would crash.
SET VARIABLES ON was broken in last build for variables with a NULLT value
(nothing was shown). Now the "varname = NULLT" will appear.
NULLT means "NULL Token", a non value, not zero, not a string, not a number.
Subreferences with arrays were broken in many cases, flakey in others.
Entire array subreference code, and variable name search code is rewritten
to handle nested subreferences. Here is a small example that now works
correctly, it failed completely in previous builds:
set test[john][a][m] aaa ; made following code fail
set test[john][b] bbb
set test[john][c] ccc
set test[john][d] ddd
set test[john]{x} xxx
set test[john]{y} yyy
set test[john]{z} zzz
set david test[john] ; failed on some multi-dimensional arrays, fixed.
set vicky strlist(@david) ; didn't work, fixed.
set edward &david[a] ; didn't work, fixed.
set bob @edward ; didn't work, fixed.
set variables on
wait
exit
----------------------------------------------------------------------------
Thu, 09 Feb 2006
XMLLOAD no longer creates lots of single element arrays for single
text elements.
Bug in SET PRINTNAME fixed, it was leaving the printname on the stack.
STREVAL is now supported, but only for a very limited subset of features
for now. The only two features supported for now are variables using
'@' and measurements.
result = streval("22in")
testvar = goodbye
result = streval("@testvar") ; gives "goodbye"
testvar = varname
varname = hello
result = streval("@@testvar") ; gives "hello"
Two new commands LOCALUNDER and LOCALUNDERS. Work exactly like LOCAL and
LOCALS except they create a variable that is local to the calling function.
For example:
test1
if !vardef(goodbye)
messagebox "goodbye undefined"
endif
exitnow
test1:
test2
messagebox goodbye1 @goodbye
return
test2:
localunder goodbye hello
messagebox goodbye2 @goodbye
return
The ARRAYATTRIB command is changed to display the indexes for attributes
in an array.
The ARRAYINDEX command now only shows indexes for an array where the
array's element has a valid value. It does not display indexes for
attributes in an array.
For example:
set test{1} a
set test{2} b
set test{3} c
set test[1] a
set test[4] b
textln strlist(arrayindex(test)) ; Displays "1 4"
textln strlist(arrayattrib(test)) ; Displays "1 2 3"
Using INC or DEC where the variable contains a string with digits in it
will no longer force the string to be converted into a number.
For example:
value = item3
for 5
; Displays "item3 item5 item7 item9 item11"
text @value$" "
inc value 2
next
For decrementing or negative values, the prefix 999 is
prepended to the numerical part.
value = item3box
for 4
; Displays "item3box item0box item9997box item9994box"
text @value$" "
inc value -3
next
----------------------------------------------------------------------------
Mon, 06 Feb 2006
Crashing bug with unicode characters in HTML fixed. Unicode characters
are now processed correctly, but igored (AG doesn't support non-8bit
character sets).
----------------------------------------------------------------------------
Thu, 02 Feb 2006
->root wasn't being filled in correctly by XML load.
New command TOMEASURE, it takes a string and if it's a numeric constant
followed by a measurement suffix it will output a measurement object.
xpos = tomeasure("50pct")
ypos = tomeasure("3.2in")
imageput @xpos @ypos example.gif
The routine which translates ASCII into float had a small rounding error
now fixed. For example 100.547 was being stored as 100.5470000001
This was preventing some floating point constants from being compiled
correctly by AGCOMP.
AGCOMP was storing floating point constants as 30 bit floating point.
If a number could not be accurated represented in 30 bits (23bit frac,
6bit exp, and 1 bit sign), then the original string version of the
number was stored. Now AGCOMP will also try fixed point scaled integer
based on INT23BITVALUE/1000. To store this in place of a 30 bit floating
point value, it uses the invalid exponent of 0 with sign of 1. This allows
common base ten values to be stored more accurately without resorting to
storing the original string version.
AGCOMP now generates BASECMD encoding for all the measurement commands
including:
centimeters
inches
millimeters
percentage
picas
pixels
pixelsx
pixelsy
points
size
This allows these commands to take up one less 32bit word each use
when encoded into compiled AGC file. Also allows for more complex
compound commands (like 12.5pct being stored in a single 32bit word).
AGCOMP when combining a constant with a BASECMD used to only support a
signed 23bit integer. Now it supports a 21bit intger, with flags for
scaled integers (divided by 1000), and for a leading tail. This allows
an expression like 12.5pct, which compiles into (12.5 topct) to be
encoded as a single 32bit word. Previously it would be encoded as
pushtail, pushnumber 12.5, call cmd_topct. Three 32bit words.
All these changes mean that any AGC files compiled with older versions of
AGCOMP may not play correctly in the new AGPLAY runtime.
Also AGC files compiled with this new version of AGCOMP absolutely will not
play correctly with older AGPLAY runtimes.
----------------------------------------------------------------------------
Mon, 30 Jan 2006
New element for arrays, ->root. This is used for XML loading and saving,
and is the root element from the XML tree. This means you must not
specify the root element when referencing an XML document you've
loaded. For example:
drawclear white
color black
xmlload "C:\WINDOWS\system32\Restore\filelist.xml" test
set variables on
textln done
textln test->root ; displays "PCHealthProtect"
excludes = array(@test["FILES"]["Exclude"]["REC"])
healthfiles = test["FILES"]
includes = array(@healthfiles["Include"]["REC"])
firstexclude = @test["FILES"]["Exclude"]["REC"][0]
forever
AfterGRASP elements are now setable, for example:
drawclear white
color black
xmlload "C:\WINDOWS\system32\Restore\filelist.xml" test
set test->root "NotPCHealthProtect"
xmlsave "C:\WINDOWS\system32\Restore\filelist.xml" test
forever
The following AfterGRASP elements are setable (be careful, some
are internal variables that may cause crashing or unpredictable
results if changed):
->bits
->edgeaveragex
->edgeaveragey
->edgecenterx
->edgecentery
->edgeradiusx
->edgeradiusy
->imagedensityx
->imagedensityy
->imagehbitmap
->imagehdc
->layerbusy
->origsizex
->origsizey
->panoangle
->panotilt
->panoview
->root
->sizex
->sizey
->textoffx
->textoffy
->virtsizex
->virtsizey
->x1
->x2
->y1
->y2
----------------------------------------------------------------------------
Thu, 26 Jan 2006
Multi-dimensional arrays can now go 32 levels deep (previously it was 10).
DIRDELETE fixed! (always been broken). Return code is the window's error
code returned by GetLastError(). Typical error is "5", for Access Denied.
Setup updated to use Innosetup 5.1.6
Crash when errors found during an XML load are fixed.
XML Element attributes are now handled by the XML load. They are referenced
like this:
text @doc[image]{test}
VARIABLES ON displays attributes with the {} around the attribute name
Attributes apply to any array, so you can do:
set example{test} 100
set example[test] 200
textln @example{test} ; displays 100
textln @example[test] ; displays 200
----------------------------------------------------------------------------
Thu, 19 Jan 2006
Install updated to add missing registry entries that AGEDIT wanted.
Internally the XMLDOC type is now the same as an array.
XML Access now working. Changes are not written back with an XMLSAVE
(the changes made to the array are not reflected into the XML tree
structure yet).
Here is a working example:
drawclear white
color black
xmlload "C:\WINDOWS\system32\Restore\filelist.xml" test
set variables on
textln done
excludes = array(@test["PCHealthProtect"]["FILES"]["Exclude"]["REC"])
healthfiles = test["PCHealthProtect"]["FILES"]
includes = array(@healthfiles["Include"]["REC"])
firstexclude = @test["PCHealthProtect"]["FILES"]["Exclude"]["REC"][0]
forever
Notice the XML tag names are in quotes to preserve their mixed (upper and
lower) case.
----------------------------------------------------------------------------
Mon, 16 Jan 2006
First new commands to support XML:
XMLNEW VARNAME
XMLLOAD FILENAME
XMLLOAD FILENAME VARNAME
XMLLOAD HTTPFTPURL
XMLLOAD HTTPFTPURL VARNAME
XMLSAVE FILENAME
XMLFREE VARNAME
The XMLLOAD actually works (If you SET VARIABLES ON you will see
it's been loaded).
drawclear white
color black
xmlload "C:\WINDOWS\system32\Restore\filelist.xml" test
set variables on
textln done
forever
Access syntax unfinished. Expected syntax is:
xmlload "C:\WINDOWS\system32\Restore\filelist.xml" test
excludes = array(@test[PCHealthProtect][FILES][Exclude][REC])
healthfiles = test[PCHealthProtect][FILES]
includes = array(@healthfiles[Include][REC])
firstexclude = test[PCHealthProtect][FILES][Exclude][REC][0]
The XML support requires WINSOCK Support, so AGPLAY is now directly linked
to call WSOCK32.DLL. This may prevent AGPLAY from working on old versions
of Win95. Let me know if this is an issue. If so, then I can create an
interface layer that looks for the DLL, much like the calls to WININET.DLL
that are done in AGPLAY right now.
New modular option XMLDOC to disable all XML support. If no XML commands
are used then AGCOMP will set XMLDOC to OFF.
----------------------------------------------------------------------------
Tue, 02 Jan 2006
Happy New Year! A couple big speed improvements made over the
holidays.
PostScript images, either printed or generated with IMAGEPOSTSCRIPT now
use LZW compression for the mask (on images that have a mask set with
IMAGEMASKSET). This results in DRASTICLY faster printing on large images
since injecting the huge hex streams for an uncompressed mask could take
minutes (and now take a few seconds).
PALETTEOPTIMIZE rewritten almost entire from scratch to use double indexed
sparse lookup tables to drasticly speed up the color search code. What
could take minutes now takes a couple seconds, with more accurate cleaner
results! This new code also has special cases to handle very large numbers
of colors (greater than 65536 colors) in the source images.
Copyright messages updated to 2006
----------------------------------------------------------------------------
Wed, 14 Dec 2005
The IMAGELOADCMYK option now defaults to on since so many image
operations now support CMYK directly.
Two new system variables, provide the filenames for new CMYK to RGB
and RGB to CMYK conversion support. The files are expected to be
48MB for the convert to RGB (6 bit accuracy, interpolation used to fill in
missing values), and 64MB to convert to CMYK (full 8 bit accuracy).
The files are basicly flat arrays, giant lookup tables read from disk when
first needed, and kept in memory until program exit.
@IMAGECONVERTTABLECMYK
Default value is "sRGB IEC61966-2.1 to CMYK US Web Coated (SWOP) v2.array"
@IMAGECONVERTTABLERGB
Default value is "CMYK US Web Coated (SWOP) v2 to sRGB IEC61966-2.1.array"
If the table cannot be loaded, then a algorithmic block of code is used
instead. The results do NOT look entirely correct since the algorithmic
code does not understand color spaces only generic raw CMYK values.
IMAGECONVERT now supports a value of -32 for bits allowing conversion
to CMYK (IMAGENEW already supported this).
All imageput operations now support converting colorspace from CMYK to RGB
and from RGB to CMYK. This includes IMAGECONVERT.
New element for images ->imagecmyk
Is zero for most images, and 1 for CMYK images.
Example:
drawclear white
color black
iscmyk[0] = "RGB"
iscmyk[1] = "CMYK"
set imageloadcmyk on
imageload cmyktest
messagebox @iscmyk[cmyktest->imagecmyk]
imageconvert 24 cmyktest
messagebox @iscmyk[cmyktest->imagecmyk]
imageput cmyktest
wait
imageconvert -32 cmyktest
messagebox @iscmyk[cmyktest->imagecmyk]
imageput 100 100 cmyktest
wait
exitnow
The ->imagepaletteadr and ->imageheadadr elements are now supported.
The ->imageheadadr points to the BITMAPINFOHEADER for an image.
The ->imagepaletteadr points to the 1024 byte palette in RGBQUAD format
(standard windows).
All file opens in AG, will search "C:\DigiLib" if the open fails.
This means the color translation files can be stuck in C:\DigiLib and AG will find them.
Without this new feature you would have to stick something like this in:
set imageconverttablergb "C:\DigiLib\\"$@imageconverttablergb
set imageconverttablecmyk "C:\DigiLib\\"$@imageconverttablecmyk
AGEDIT data files updated for new variables and element.
----------------------------------------------------------------------------
Sun, 11 Dec 2005
PALETTEOPTIMIZE has a series of special cases added for large numbers
of colors (many thousands). This is to speed up those cases which were
taking minutes to run. This sacrifices a small amount of accuracy in
those cases.
IMAGESIZE (and image scaling in general) had a rounding error which
would slightly reduce the brightness of some colors in some cases. Fixed.
Drawing a 24bit/32bit hicolor image to a 8bit buffer is now dramaticly
higher quality. It's also very slow since it calculates each pixel
by finding the best match in the palette. This corrects incorrect
results when using IMAGECONVERT 8, and IMAGESIZE on 8bit images.
----------------------------------------------------------------------------
Thu, 08 Dec 2005
AGEDIT replaced with older build from last December recompiled without
the expiration date.
AGEDIT Data files for commands, variables and elements are all updated.
DRAWPIXEL with a color fixed, it was treating the color and coordinate
pair as a RGB triplet.
DRAWPIXEL, COLORGET, and IMAGESIZE all fixed to correctly handle CMYK
images (true 32 bits per pixel).
----------------------------------------------------------------------------
Tue, 06 Dec 2005
NETOPENWEBPAGE used to create a temp file called "AG.HTM" in the Windows
directory. The problem is, if you are a user without administrator privilages
this will fail.
So NETOPENWEBPAGE now uses the TEMP directory (and if that's not defined
it uses C:\)
Two new commands, APPCREATESHORTCUT and APPRESOLVESHORTCUT.
APPCREATESHORTCUT FILENAME DESCRIPTION PATH
Example:
appcreateshortcut "c:\\example.exe" "My Example" "C:\\Documents and Settings\\Administrator\\Desktop\\Example.lnk"
TRUEPATH = APPRESOLVESHORTCUT(PATH)
Example:
text appresolveshortcut("C:\\Documents and Settings\\Administrator\\Desktop\\Example.lnk")
; displays "c:\example.exe"
----------------------------------------------------------------------------
Sun, 04 Dec 2005
The IMAGEPOSTSCRIPT now works with decompressed images (ones loaded without
IMAGECOMPRESSED ON), it also works with CMYK decompressed images, and
images with IMAGEMASKSET.
New system variable IMAGELOADCMYK, defaults to OFF, when ON, a CMYK JPEG
when loaded will NOT be converted to RGB, it will be left as CMYK. This
is mainly to be used for special printing applications and modifying CMYK
images. Defaults to OFF
SET IMAGELOADCMYK ON
SET IMAGELOADCMYK OFF
New option for IMAGECOMPRESSED, can now be set to BOTH which whenloading
JPEGs will decompress the PEG as if IMAGECOMPRESSED was OFF, but will
also load the compressed image file as well. All operations will use
the decompressed image data except when writing to a PostScript printer
where the compressed JPEG data will be used instead. Defaults to OFF
Still has problems with some commands like IMAGESIZE.
SET IMAGECOMPRESSED ON
SET IMAGECOMPRESSED OFF
SET IMAGECOMPRESSED BOTH
Runable example:
drawclear white
color black
imageload cmyktest.jpg test
imageflood test pkgmask top left 8 ; create a mask (8% match)
imagemaskset test pkgmask
drawclear red
imageput test
imagefree test
set imagecompressed on
imageload cmyktest.jpg test
set imagecompressed off
imagemaskset test pkgmask
imagefree pkgmask
;
; create a PostScript EPS file
;
fname = "test.eps"
pshead = "%!PS-Adobe-3.0 EPSF-3.0"$@crlf
psmedia = "%%DocumentMedia: CustomMedia @XSIZE @YSIZE 0 white CustomMedia"$@crlf
psmedia = strreplace(@psmedia, "@XSIZE", test->sizex, "@YSIZE", test->sizey)
psbounding = "%%BoundingBox: 0 0 @XSIZE @YSIZE"$@crlf
psbounding = strreplace(@psbounding, "@XSIZE", test->sizex, "@YSIZE", test->sizey)
pscomments = "%%DocumentData: Clean7Bit"$@crlf$"%%LanguageLevel: 2"$@crlf$"%%EndComments"$@crlf$"%%BeginProlog"$@crlf$"%%EndProlog"$@crlf$"%%Page: 1 1"$@crlf$"%%PageMedia: CustomMedia"$@crlf
pspagesize = "<< /PageSize [@XSIZE @YSIZE] >> setpagedevice"$@crlf
pspagesize = strreplace(@pspagesize, "@XSIZE", test->sizex, "@YSIZE", test->sizey)
psimage = imagepostscript(0, 0, test->sizex, test->sizey, test)
pstail = "%%EOF"$@crlf
postimage = @pshead$$@psmedia$@psbounding$@pscomments$@pspagesize$@psimage$@pstail
filedelete "c:\test.eps"
filesend "c:\test.eps" @postimage
;
; create a PostScript file of just this image, masked, original JPEG
;
set printfilename "c:\test.ps"
printstart
printstartpage
printset
imagesize 100pct 0 test
imageput test
imageset
printendpage
printend
exitnow
Four new system variables for debugging:
@DEBUGLINE returns current linenumber in script
@DEBUGLINES returns the last 100 linenumbers executed in script
@DEBUGSCRIPT returns current scriptname
@DEBUGSCRIPTS returns the scriptname for the last 100 lines executed
@DEBUGLINES and @DEBUGSCRIPTS would normally used with ARRAY()
ARRAY(@DEBUGLINES)[0] gives the same result as @DEBUGLINE
ARRAY(@DEBUGSCRIPTS)[0] gives the same result as @DEBUGSCRIPT
----------------------------------------------------------------------------
Thu, 17 Nov 2005
Long standing bugs in TEXTHEIGHT and TEXTWIDTH where the results could be
incorrect if done after complex HTML/RTF text is fixed.
----------------------------------------------------------------------------
Wed, 09 Nov 2005
New option for the HTTP command, HTTP GET, returns the web page as a string.
For example:
messagebox http(get,"http://www.google.com")
Or to detect a connection:
connected = @FALSE
if @netconnected
http get "http://www.google.com"
connected = !@httpERROR
endif
if !@connected
messagebox "Internet Connection Not Working"
exitnow
endif
@NETCONNECTED variable now supported.
Valid return values are either -1 for no available (no networking).
or a integer between 0 and 7 that is one or more of these
flags added together.
; Local system uses a modem to connect to the Internet.
GLOBAL INTERNET_CONNECTION_MODEM 1
; Local system uses a local area network to connect to the Internet.
GLOBAL INTERNET_CONNECTION_LAN 2
; Local system uses a proxy server to connect to the Internet.
GLOBAL INTERNET_CONNECTION_PROXY 4
NETCONNECT command now supported
NETCONNECT AUTODIAL
NETCONNECT AUTOHANGUP
NETCONNECT DIAL ; unsupported
NETCONNECT HANGUP ; does the same as AUTOHANGUP
Two new system variables @HTTPGETFLAGS and @HTTPPUTFLAGS,
They control the HTTP GET* and HTTP PUT* commands.
Default values are:
SET HTTPGETFLAGS TRANSFER_BINARY RELOAD DONT_CACHE
SET HTTPPUTFLAGS NO_CACHE_WRITE
All the options available are:
ASYNC
CACHE_ASYNC
CACHE_IF_NET_FAIL
EXISTING_CONNECT
FORMS_SUBMIT
FROM_CACHE
HYPERLINK
KEEP_CONNECTION
MAKE_PERSISTENT
NEED_FILE
NO_AUTH
NO_AUTO_REDIRECT
NO_CACHE_WRITE
NO_COOKIES
NO_UI
PASSIVE
PRAGMA_NOCACHE
RAW_DATA
READ_PREFETCH
RESYNCHRONIZE
SECURE
TRANSFER_ASCII
TRANSFER_BINARY
Details on these options specific to GET/PUT:
HTTPGETFLAGS:
EXISTING_CONNECT
Attempts to use an existing InternetConnect object if one exists with the
same attributes required to make the request. This is useful only with FTP
operations, since FTP is the only protocol that typically performs multiple
operations during the same session. The WinINet API caches a single
connection handle for each HINTERNET handle generated by
InternetOpen. InternetOpenUrl uses this flag for HTTP and FTP
connections.
HYPERLINK
Forces a reload if there was no Expires time and no LastModified time
returned from the server when determining whether to reload the item
from the network.
IGNORE_CERT_CN_INVALID
Disables checking of SSL/PCT-based certificates that are returned from
the server against the host name given in the request. WinINet functions
use a simple check against certificates by comparing for matching host
names and simple wildcarding rules.
IGNORE_CERT_DATE_INVALID
Disables checking of SSL/PCT-based certificates for proper validity
dates.
IGNORE_REDIRECT_TO_HTTP
Disables detection of this special type of redirect. When this flag is used,
WinINet transparently allows redirects from HTTPS to HTTP URLs.
IGNORE_REDIRECT_TO_HTTPS
Disables the detection of this special type of redirect. When this flag is
used, WinINet transparently allows redirects from HTTP to HTTPS
URLs.
KEEP_CONNECTION
Uses keep-alive semantics, if available, for the connection. This flag is
required for Microsoft Network (MSN), NTLM, and other types of
authentication.
NEED_FILE
Causes a temporary file to be created if the file cannot be cached.
NO_AUTH
Does not attempt authentication automatically.
NO_AUTO_REDIRECT
Does not automatically handle redirection in HttpSendRequest.
NO_CACHE_WRITE
Does not add the returned entity to the cache.
NO_COOKIES
Does not automatically add cookie headers to requests, and does not
automatically add returned cookies to the cookie database.
NO_UI
Disables the cookie dialog box.
PASSIVE
Uses passive FTP semantics. InternetOpenUrl uses this flag for FTP files
and directories.
PRAGMA_NOCACHE
Forces the request to be resolved by the origin server, even if a cached
copy exists on the proxy.
RAW_DATA
Returns the data as a GOPHER_FIND_DATA structure when retrieving
Gopher directory information, or as a WIN32_FIND_DATA structure
when retrieving FTP directory information. If this flag is not specified or
if the call was made through a CERN proxy, InternetOpenUrl returns the
HTML version of the directory.
RELOAD
Forces a download of the requested file, object, or directory listing from
the origin server, not from the cache.
RESYNCHRONIZE
Reloads HTTP resources if the resource has been modified since the last
time it was downloaded. All FTP and Gopher resources are reloaded.
SECURE
Uses secure transaction semantics. This translates to using Secure
Sockets Layer/Private Communications Technology (SSL/PCT) and is
only meaningful in HTTP requests.
HTTPPUTFLAGS:
CACHE_IF_NET_FAIL
Returns the resource from the cache if the network request for the
resource fails due to an ERROR_INTERNET_CONNECTION_RESET
(the connection with the server has been reset) or
ERROR_INTERNET_CANNOT_CONNECT (the attempt to connect to
the server failed).
HYPERLINK
Forces a reload if there was no Expires time and no LastModified time
returned from the server when determining whether to reload the item
from the network.
IGNORE_CERT_CN_INVALID
Disables checking of SSL/PCT-based certificates that are returned from
the server against the host name given in the request. WinINet functions
use a simple check against certificates by comparing for matching host
names and simple wildcarding rules.
IGNORE_CERT_DATE_INVALID
Disables checking of SSL/PCT-based certificates for proper validity
dates.
IGNORE_REDIRECT_TO_HTTP
Disables detection of this special type of redirect. When this flag is used,
WinINet functions transparently allow redirects from HTTPS to HTTP
URLs.
IGNORE_REDIRECT_TO_HTTPS
Disables detection of this special type of redirect. When this flag is used,
WinINet functions transparently allow redirects from HTTP to HTTPS
URLs.
KEEP_CONNECTION
Uses keep-alive semantics, if available, for the connection. This flag is
required for Microsoft Network (MSN), NT LAN Manager (NTLM), and
other types of authentication.
NEED_FILE
Causes a temporary file to be created if the file cannot be cached.
NO_AUTH
Does not attempt authentication automatically.
NO_AUTO_REDIRECT
Does not automatically handle redirection in HttpSendRequest.
NO_CACHE_WRITE
Does not add the returned entity to the cache.
NO_COOKIES
Does not automatically add cookie headers to requests, and does not
automatically add returned cookies to the cookie database.
NO_UI
Disables the cookie dialog box.
PRAGMA_NOCACHE
Forces the request to be resolved by the origin server, even if a cached
copy exists on the proxy.
RELOAD
Forces a download of the requested file, object, or directory listing from
the origin server, not from the cache.
RESYNCHRONIZE
Reloads HTTP resources if the resource has been modified since the last
time it was downloaded. All FTP and Gopher resources are reloaded.
SECURE
Uses secure transaction semantics. This translates to using Secure
Sockets Layer/Private Communications Technology (SSL/PCT) and is
only meaningful in HTTP requests.
----------------------------------------------------------------------------
Mon, 07 Nov 2005
Serious bug in AGCOMP not correctly compressing compiled scripts is fixed.
This bug has been in since the upgrade to a newer ZLIB in Jul 2005.
The modular compiler "OPTION" command now has 2 other possible parameters.
Previously only "ON" and "OFF" were accepted. Now, "FORCEON" and "FORCEOFF"
are also accepted. "ON" and "OFF" work as before, they can be overidden
by AGCOMP if it thinks a block code is required or not required.
FORCEON and FORCEOFF are absolute, they will not be overridden. If you use
for instance OPTION LAYERS FORCEOFF, the code to handle layers will absolutely
not be linked into the modular runtime. FORCEON/FORCEOFF also works with "ALL"
but it not particularly useful. OPTION ALL FORCEON will include all
modular code (except for commands not used), and OPTION ALL FORCEOFF will
force all modular code to be excluded.
AGCOMP is now a great deal smarter about what modular options should
automaticly enabled or disabled. For instance OPTION ALL OFF will now
allow the SCROLLBOX command to work correctly.
----------------------------------------------------------------------------
Sun, 30 Oct 2005
Small memory leak in WINFONT/FONTDEFINE fixed (one extra instance of font's
variable name was created).
Three new FONTSTYLE/WINFONTSTYLE options:
VARIATION, VARIATIONS and ALLVARIATIONS
FONTSTYLE VARIATION SUFFIX STYLE STYLE STYLE
SUFFIX is the up to 16 character suffix added to the variable
name for this variation of the base font variable name.
STYLE is one or more styles, only weight, italic, underline and
strikeout are accepted, others are ignored.
The variation ends with the next variation command, or the end of the fontstyle
parameters.
Two shortcut options to create common multiple variations:
FONTSTYLE VARIATIONS
The same as:
VARIATION B BOLD VARIATION I ITALIC VARIATION U UNDERLINE VARIATION S STRIKEOUT
FONTSTYLE ALLVARIATIONS
The same as:
VARIATION B BOLD VARIATION I ITALIC VARIATION U UNDERLINE VARIATION S STRIKEOUT
VARIATION BI BOLD ITALIC VARIATION BU BOLD UNDERLINE VARIATION BS BOLD STRIKEOUT
VARIATION IU ITALIC UNDERLINE VARIATION IS ITALIC STRIKEOUT
VARIATION US UNDERLINE STRIKEOUT
VARIATION BIU BOLD ITALIC UNDERLINE VARIATION BIS BOLD ITALIC STRIKEOUT
VARIATION BUS BOLD UNDERLINE STRIKEOUT VARIATION IUS ITALIC UNDERLINE STRIKEOUT
Runable example:
drawclear white
color black
fontstyle anti allvariations variation l light
fontdefine aarial22 "Arial" 22
set variables on
for fn in strlist(varmatch("aarial22*"))
font @fn
textln @fn
next
drawregion 50pct 0 100pct 100pct
fontstyle init allvariations variation l light
fontdefine arial22 "Arial" 22
set variables on
for fn in strlist(varmatch("arial22*"))
font @fn
textln @fn
next
forever
----------------------------------------------------------------------------
Thu, 27 Oct 2005
New command STRSPLIT, takes a one or more strings followed by a split
value. It splits the strings into multiple strings where ever the
split value is found. For instance:
for word in strlist(strsplit("Hello there this is a string"," "))
textln @quote$@word$@quote
next
Displays:
"Hello"
"there"
"this"
"is"
"a"
"string"
Using multiple strings:
words = array(strsplit("Hello there this is a string","and this is another string"," "))
textln @words[0] ; Displays Hello
textln @words[6] ; Displays and
Using a multiple character split value:
words = array(strsplit(strlist(1,2,3,4),@crlf))
for i in strlist(@words)
text @i
next
The comparison operators (less than, greater than, less than or equal,
greater than or equal, equal and not equal) now work on measurements.
They do not handle different measurements. So for instance you cannot
compare inches to percentage. But you can compare inches to mm.
Multiply and Divide of Measurements now handles like measurements,
so for instance you can say 10pct*3pct. This is in addition to
Multiply and Divide of numbers, which already worked, like this:
(10pct+5)*1.5 or 11in/3.
Problems with adding/subtracting measurements that were previously
multiplied or divided are fixed.
The SET VARIABLES ON display is brought up to date, it had not been updated
since early 2003! In particular the MEASURE type is fully displayed.
Other types displayed (but only minimally):
VECTORDATA
INPUT
IMAGEFADE
SOUND
DATABASE
DBFIELDNAME
DBINDEX
DBCACHE
DBRECORDCACHE
SCROLLBOX
The mm and cm measurements now remember they are metric so the VARIABLES
display will show them in mm instead of inches. If you add mm to inches
the resulting value will display as metric in the VARIABLES display.
LIBXML2 library added to project as part of investigating XML support,
(not linked in yet).
----------------------------------------------------------------------------
Tue, 18 Oct 2005
The error message for an invalid label used with GOSUB/WHEN/HOTSPOT now
gives the name of the incorrect label. This is extremely useful for
tracking down a incorrect WHEN/HOTSPOT when you've done a SCRIPTLINK
to a script without the label for a active WHEN/HOTSPOT.
DRIVEFILELIST with long paths was broken since (13 Oct 2005) build. Fixed.
----------------------------------------------------------------------------
Sun, 16 Oct 2005
Two new commands, IMAGEROW and IMAGECOLUMN. They take one or more images
and returns a single image with all the images passed to it lined up in
a column column or row. Accepts wildcards and arrays of images.
Example:
diaw = array(diaw1, diaw2, diaw3, diaw4, diaw5)
for pic in strlist(@diaw)
imageload @pic
next
global diawrow imagerow(@diaw)
----------------------------------------------------------------------------
Thu, 13 Oct 2005
Huge number of fixes for NULL or Blank parameters, all these commands
are affected (they would crash back to windows):
ARRAYEXCEPT
ARRAYEXTRACT
DESKTOPWALLPAPER
FILECOPY
FILEDELETE
IMAGEALPHASET
IMAGECENTER
IMAGEFINDCENTER
IMAGEFINDEDGES
IMAGESPOTCOLOR
IMAGETRIM
INIGET
INISET
MEMGETSTRING
NETOPENWEBPAGE
PRINTSTART
RANDOM
SCREENSAVER
SCRIPTLINK
STRASC
STRSORT
STRWILDSEARCH
WINDOWSIZE
WINFONT
WINFONTSTYLE
Three commands added:
STRENCRYPTBLOWFISH
STRDECRYPTBLOWFISH
UNGLOBAL
The BLOWFISH commands have the exact same syntax as STRENCRYPTAES256
and STRDECRYPTAES256
UNGLOBAL removes a global variable. Much like FREE except the variable
is completely removed.
----------------------------------------------------------------------------
Tue, 11 Oct 2005
SCROLLBOX has a new TEXTELEVATORGAP option which is how many pixels to
offset the elevator shaft from the text (reducing the size of the text
area).
SCROLLBOX TEXTOFFSET now supports measurements
SET TEXTTABSIZE now supports measurements
Negative now works on measurements, so for instance:
set texttabsize -(20pct)
----------------------------------------------------------------------------
Thu, 06 Oct 2005
Bug with a trailing "<" character in a text string causing the next text
statement to hang fixed.
----------------------------------------------------------------------------
Wed, 05 Oct 2005
New command VECSIZE calculates the distance between two points:
HYP = VECSIZE(X1,Y1,X2,Y2)
Same as:
hyp = sqrt((@x1-@x2)*(@x1-@x2)+(@y1-@y2)*(@y1-@y2))
DRAWBOXROUND now accepts measurements for all parameters.
----------------------------------------------------------------------------
Mon, 26 Sep 2005
Memory leaks found in:
SCRIPTMERGE - was leaving zeros on the stack
DRAWANTIBOX - All DrawAnti commands were leaving junk on stack
DRAWANTIBOXROUND
DRAWANTICIRCLE
DRAWANTICIRCLEFILLED
DRAWANTILINE
DRAWANTIPOLYGON
DRAWANTIPOLYGONFILLED
DRAWANTIRECT
DRAWANTIRECTROUND
LAYERLEVEL was leaving ones and zeros on the stack
All of these could cause crashes and other errors as AG runs out of
stack space.
----------------------------------------------------------------------------
Thu, 15 Sep 2005
IMAGESIZE now scales the IMAGEPOSITION
IMAGECOPY now correctly copies the IMAGEPOSITION
IMAGESAVEGIF now saves the IMAGEPOSITION (other programs may not like
negative offsets).
New command VECROTATE, rotates a point around another point given
an angle.
SETS NEWXPOS NEWYPOS VECROTATE(CENTXPOS CENTYPOS XPOS YPOS ANGLE)
Example routine that rotates the coordinates of a filled rectangle,
creating a masked image of the rotated rectangle:
rotatedimage:
declare xs ys angle
box = rotatebox(0, 0, @xs, @ys, @angle)
color white
imagenew masktemp @box[width] @box[height]
imageset masktemp
color 0
drawpolygonfilled @box[x1] @box[y1] @box[x2] @box[y2] @box[x3] @box[y3] @box[x4] @box[y4]
imageset
imageposition @box[areax1] @box[areay1] masktemp
color white
imagenew recttemp @box[width] @box[height]
imageset recttemp
color (@textfield[@pagenum][@f][rectcolor])
drawpolygonfilled @box[x1] @box[y1] @box[x2] @box[y2] @box[x3] @box[y3] @box[x4] @box[y4]
imageset
imageposition @box[areax1] @box[areay1] recttemp$@f
imagemaskset recttemp masktemp
imagefree masktemp
return @masktemp
rotatebox:
declare cx cy width height angle
local result[xs] @width
local result[ys] @height
local result[cx] @cx
local result[cy] @cy
locals result[x1] result[y1] vecrotate(@cx, @cy, 0, 0, @angle)
locals result[x2] result[y2] vecrotate(@cx, @cy, @width-1, 0, @angle)
locals result[x3] result[y3] vecrotate(@cx, @cy, @width-1, @height-1, @angle)
locals result[x4] result[y4] vecrotate(@cx, @cy, 0, @height-1, @angle)
local result[areax1] min(@result[x1],@result[x2],@result[x3],@result[x4])
local result[areay1] min(@result[y1],@result[y2],@result[y3],@result[y4])
local result[areax2] max(@result[x1],@result[x2],@result[x3],@result[x4])
local result[areay2] max(@result[y1],@result[y2],@result[y3],@result[y4])
local result[width] 1+@result[areax2]-@result[areax1]
local result[height] 1+@result[areay2]-@result[areay1]
result[x1] = @result[x1]-@result[areax1]
result[y1] = @result[y1]-@result[areay1]
result[x2] = @result[x2]-@result[areax1]
result[y2] = @result[y2]-@result[areay1]
result[x3] = @result[x3]-@result[areax1]
result[y3] = @result[y3]-@result[areay1]
result[x4] = @result[x4]-@result[areax1]
result[y4] = @result[y4]-@result[areay1]
return &result
----------------------------------------------------------------------------
Sun, 11 Sep 2005
Long standing bug in WINDOWSIZE used to resize a window that has active
layers is fixed. This eliminates wierd glitches and missing sections of
the window.
----------------------------------------------------------------------------
Wed, 07 Sep 2005
Bug in Modular compiler not including LAYERTEXT, LAYERTEXTWIDTH,
LAYERTEXTHEIGHT, and LAYERTEXTOFFSET for use by the SCROLLBOX command
is fixed.
Bug in Modular compiler not doing a MEASURE ON if the NUMBERsize operator
is used is fixed.
Freeing of SCROLLBOXes was broken (didn't happen until program exit). Fixed.
Memory leak in WHENs with labels, HOTSPOTs and SCROLLBOXes is fixed. They
were all gobbling up dictionary entries and memory, this bug dates back
to December 2002!
----------------------------------------------------------------------------
Tue, 06 Sep 2005
Complete list of Modular options (SCROLLBOXES is new as of a few builds
ago):
ALL
BMPLOAD
DATABASE
DEBUG
FADES
FONTDEFINE
FONTLOAD
FTP
GIFLOAD
GIFSAVE
GLILOAD
HOTSPOTS
HTMLLINK
HTMLTEXT
HTTP
ICOLOAD
IMAGESCALE
INPUT
INTERNET
JPEGLOAD
JPEGSAVE
LAYERS
MEASURE
PANVIEW
PNGLOAD
PNGSAVE
PRINT
RTFTEXT
SCROLLBOXES
SOUND
TIFFLOAD
TIFFSAVE
WHENS
WINFONT
Bug in stretched elevator cars (SCROLLBOX), wasn't stretching on
small images, fixed.
AGCOMP now handles enabling modular options required for SCROLLBOXES.
----------------------------------------------------------------------------
Sun, 04 Sep 2005
Two new commands MOUSECURSORSCROLL and MOUSECUSTOMSCROLL.
They work exactly like MOUSECURSORHOT and MOUSECUSTOMHOT except the
cursor they define is used for scrollboxes when you roll the mouse
inside the arrows or elevator.
----------------------------------------------------------------------------
Thu, 01 Sep 2005
Extensive special case support for SCROLLBOX added.
It now handles any combination of:
different sized arrow images
different sized click down arrow images
a different sized elevator boxcar image
a different elevatorwidth parameter
Any combination will work, the images are centered within their alloted
space, and the entire arrow/scrollbox area is enlarged to handle how
even large is needed for all the images.
If the scrollbar will not fit (images are too tall, or the scrollbox is too
short), then no arrows or scrollbox is displayed, it's treated the same
as if the text fit entirely in the scrollbox.
----------------------------------------------------------------------------
Tue, 30 Aug 2005
SCROLLBOX has the elevator car slightly more attractive (rounded corners)
SSCROLLBOX ELEVATORSTRETCH now stretches an ELEVATORIMAGE. It duplicates
the bottom half of the original elevator car image, duplicates the
center scan line over and over to fill the extra space, and then duplcates
the top half of the original car image.
The generated elevator car is limited to no shorter than 5 pixels tall.
If the text in a SCROLLBOX is shorter than the scrollbox, then no
arrows or elevator are displayed, and the additional space where the
arrows and elevator would be are used to display the text.
Here is the text script I used to ensure the stretch elevator works:
width = 640
height = 600
windowsize @width @height
drawclear white
color black
textln "Scrollbox test"
fontstyle anti
fontdefine "Arial" 20
set variables on
color red
drawregion 50 50 (@width-100)size (@height-100)size
drawbox @drawminx @drawminy @drawmaxx @drawmaxy 5
drawregion @drawminx+6 @drawminy+6 @drawmaxx-6 @drawmaxy-6
color black
scrollbox test text strline(fileget(potter.txt),1,1) elevatorimage elevatorcar.bmp
delay 200
scrollbox test text strline(fileget(potter.txt),1,5)
forever
----------------------------------------------------------------------------
Mon, 29 Aug 2005
New SCROLLENABLE and SCROLLDISABLE to enable/disable scrollboxes
(much like HOTENABLE and HOTDISABLE for hotspots).
SCROLLBOX command in and working:
Options are:
POSITION XPOS YPOS [X2 Y2]
SIZE WIDTH HEIGHT
TEXT STRING
TEXTADD STRING
TEXTLINE LINENUM
TEXTOFFSET [XOFFSET] YOFFSET
TEXTSTEP YPIXELS ; default is 3
TEXTDELAY DELAYTIME1000 ; default is 1000/60
ELEVATORCOLOR COLOR
ELEVATORCOLORBACK COLOR
ELEVATORCOLOREDGE COLOR
ELEVATORIMAGE IMAGEBUF
ELEVATORSTRETCH ; default is STRETCH (not FIXED)
ELEVATORFIXED
ELEVATORWIDTH WIDTH ; default is 32
ARROWCOLOR COLOR
ARROWCOLORBACK COLOR
ARROWCOLOREDGE COLOR
ARROWCLICKCOLOR COLOR
ARROWCLICKCOLORBACK COLOR
ARROWCLICKCOLOREDGE COLOR
ARROWIMAGEUP IMAGEBUF
ARROWIMAGEDOWN IMAGEBUF
ARROWCLICKIMAGEUP IMAGEBUF
ARROWCLICKIMAGEDOWN IMAGEBUF
Elements available for scrollbox bufs:
->SIZEX
->SIZEY
->X1
->Y1
->X2
->Y2
->TEXT
->TEXTLINE
->TEXTOFFX
->TEXTOFFY
->X1, ->Y1, ->X2, ->Y2 are also supported for IMAGES and LAYERS
as well as SCROLLBOXES
->TEXT, ->TEXTLINE, ->TEXTOFFX, ->TEXTOFFY are also supported for
LAYERS as well as SCROLLBOXES.
->LAYERTEXT, ->LAYERTEXTLINE, ->LAYERTEXTOFFX and ->LAYERTEXTOFFY
are removed (they were always returning zero anyway).
width = 640
height = 600
windowsize @width @height
drawclear white
color black
textln "Scrollbox test"
fontstyle anti
fontdefine "Arial" 20
set variables on
color red
drawregion 50 50 (@width-100)size (@height-100)size
drawbox @drawminx @drawminy @drawmaxx @drawmaxy 5
drawregion @drawminx+6 @drawminy+6 @drawmaxx-6 @drawmaxy-6
color black
scrollbox test text fileget(potter.txt)
forever
Know issues:
The Elevator Car is ugly, and the stretch code isn't done yet.
When clicking outside the Elevator Car within the Elevator Shaft,
the Pageup & Pagedown work, but do not auto-repeat, and there is
no "blink" of the empty shaft to show the click "worked". My attempts
at auto-repeat were very quirky, so I disabled that for now.
Performance near the bottom of long documents can be quite slow,
this requires optimizing the text formatting engine, perhaps storing
"way points" to speed up formatting of long documents. I'll have
to run it through a profiler to get some real idea on where the
majority of time is spent.
The TEXTDELAY autorepeat when holding down an arrow button is
sometimes quirky. I suggest a very small TEXTDELAY, and adjust
TEXTSTEP instead.
There are no keyboard shortcuts yet, no arrow keys, no pageup/down,
no home/end.
The TEXTOFFSET on the X Axis is not supported, it will not work
correctly, and there are no plans for horizontal arrows/elevators.
There may be odd quirks if displaying a document shorter than the
scrollbox. In future it will not display arrows or elevator if the
text fits.
----------------------------------------------------------------------------
Mon, 12 Aug 2005
Bug in drawregion which was not reseting the search for leading spaces in
HTML text is fixed. This also applies to using IMAGENEW, and then IMAGESET
to draw text in an image.
New command SCROLLFREE, much like HOTFREE except it's for SCROLLBOXES created
with the SCROLLBOX command.
----------------------------------------------------------------------------
Sat, 30 Jul 2005
Further rewrites of ZLIB support so that only one tiny change to ZCONF.H
is now required to switch ZLIB versions.
ZLIB upgraded to v1.23.
FILEZIPAS and FILEZIP now correctly store the file date and time in
the ZIP that is created. If the source file has no date (is from memory
or a GL/EXE), then the current system date and time are used.
----------------------------------------------------------------------------
Fri, 29 Jul 2005
FILEZIPAS and FILEZIP were broken by the ZLIB upgrade. Numerous
changes required in the MINIZIP code (which has quite a few hardcoded
references to the standard C library).
----------------------------------------------------------------------------
Thu, 28 Jul 2005
New system variable:
SET TEXTFROMSTRIP ON/OFF
Defaults to OFF.
When enabled (ON), any leading spaces, or line feeds will be stripped
before text when using the TEXTFROM command. Useful for splitting
up documents, and eliminating extra leading whitespace.
New SCROLLBOX command started, not functional.
----------------------------------------------------------------------------
Thu, 21 Jul 2005
Loading of PNG images is working!
LIBPNG reverted to original source code for LIBPNG 1.2.8, now uses
compiler defines for changes.
Method of passing file handle to LIBPNG rewritten to avoid odd errors.
Rewrote code which copies PNG images to work with more recent LIBPNG.
Numerous checks added for unusual PNG formats to convert them into something
that AfterGRASP can handle (like greyscale with alpha gets converted to RGBA,
and 16bit greyscale gets converted to 8bit).
Work around added for "png_read_end" bug (call removed for now).
----------------------------------------------------------------------------
Wed, 20 Jul 2005
HTML Text now supports the
tags. They switch the current font
to "Courier New", and allow all tabs, spaces and newlines to be drawn.
For example:
drawclear white
set htmltext on
text "Table
text "
1 Shoe 2001
2 Cat 2002
3 Horse 2003
4 Cabinet 2004
"
wait
exitnow
More error checking for GIF loading added, particularly in the
width/height fields.
Bug when ERRORLOAD OFF where the variable would be created, but no
value stored in it is fixed. For instance this would have
displayed "1" even if bad_gif_file.gif was corrupt. Now it correctly
will display "0".
drawclear white
set errorload off
imageload bad_gif_file.gif test
messagebox vardef(test)
exitnow
----------------------------------------------------------------------------
Tue, 19 Jul 2005
Treat this build as a true beta, there was extensive work required to
update ZLIB. There may be new bugs as a result.
ZLIB version 1.14 replaced with 1.22. This unfortunately does not fix
the PNG load, it still fails.
Clipping bug in DRAWCLEAR fixed, it now always clips to the current
drawregion (it wasn't doing so sometimes).
----------------------------------------------------------------------------
Mon, 18 Jul 2005
New LAYER command:
LAYER LEVEL to set the exact depth of a layer. So instead of above or below
you can set the exact level of a layer: It takes a single parameter, an integer
which can be any value. Giving two layers the same level will not work (the
command will be ignored). You cannot have two layers with the same level.
Returns either 0 (failure), or 1 (success). The default LEVEL for a newly
created layer is 1 more than the highest level is use (if none, then 0).
LAYER ABOVE sets the LEVEL to be 1 more than the highest, LAYER BELOW is
1 less than the lowest level in use.
----------------------------------------------------------------------------
Sun, 17 Jul 2005
4 new commands added!
COLORDIALOG COLORVARIABLE
COLORDIALOGOPTIONS OPTION1 OPTION2 OPTION3...
Color Dialog Options:
ANYCOLOR
ENABLEHOOK
ENABLETEMPLATE
ENABLETEMPLATEHANDLE
FULLOPEN
PREVENTFULLOPEN
RGBINIT
SHOWHELP
SOLIDCOLOR
COLORDIALOGSET and COLORDIALOGGET are to set and retrieve the color
dialog's fixed 16 color palette (which a user can change):
RESULTARRAY16 = ARRAY(COLORDIALOGGET())
COLORVALUE = COLORDIALOGGET(INDEX)
If COLORDIALOGGET is passed no parameters, it returns all 16 colors
from the color dialog's palette. Otherwise it can be passed 1
or more indexes (from 0 to 15)
COLORDIALOGSET @ARRAY16 (16 color values, no names or R G B)
COLORDIALOGSET INDEX COLORVALUE
If COLORDIALOGSET is passed 16 colors (integers), then it sets
the 16 palette colors in the COLORDIALOG to those 16 colors.
Otherwise, it treats the first parameter as an index from 0 to 15,
and the 2nd parameter as a color value (names, and R, G, B triplets
are acceptable).
Runable example:
drawclear white
color black
colordialogoptions fullopen anycolor
for idx from 0 to 15
colordialogset @idx @idx*16+15 @idx*16+15 @idx*16+15
next
colordialog colorvalue
drawclear @colorvalue
wait
exitnow
----------------------------------------------------------------------------
Tue, 12 Jul 2005
FILEZIP and FILEZIPAS were not closing files opened to be copied into
the ZIP. This meant they could not be deleted until your program
exited. Fixed.
New commands REGGETLIST and REGGETKEYLIST:
RESULT = STRLIST( REGGETLIST(KEYROOT APPNAME) )
RESULT = ARRAY( REGGETLIST(KEYROOT APPNAME) )
messagebox strlist(reggetlist(LOCAL_MACHINE,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts"))
RESULT = STRLIST( REGGETKEYLIST(KEYROOT APPNAME) )
RESULT = ARRAY( REGGETKEYLIST(KEYROOT APPNAME) )
messagebox strlist(reggetkeylist(LOCAL_MACHINE,"SOFTWARE\Microsoft\Windows NT\CurrentVersion"))
----------------------------------------------------------------------------
Thu, 07 Jul 2005
Two new commands, FONTDIALOG and FONTDIALOGOPTIONS
FONTDIALOG FONTNAMEVAR FONTSIZEVAR FONTSTYLEVAR
FONTNAMEVAR - variable name for string variable that will contain the
name of the font.
FONTSIZEVAR - variable name for the integer variable that will contain
the height of the font.
FONTSTYLEVAR - variable name for the array variable that will contain
an array of font style options suitable for the FONTSTYLE
and WINFONTSTYLE commands.
Example:
drawclear white
fontdialog fontnamevar fontsizevar fontstylevar
fontstyle init anti @fontstylevar
fontdefine myfont @fontnamevar @fontsizevar
font myfont
color black
text "Hello There"
wait
exitnow
FONTDIALOGOPTIONS OPTION1 OPTION2 OPTION3....
Options for FONTDIALOGOPTIONS
Control options:
ANSIONLY
BOTH
EFFECTS
ENABLEHOOK
ENABLETEMPLATE
ENABLETEMPLATEHANDLE
FIXEDPITCHONLY
FORCEFONTEXIST
INITTOLOGFONTSTRUCT
LIMITSIZE
NOFACESEL
NOOEMFONTS
NOSCRIPTSEL
NOSIMULATIONS
NOSIZESEL
NOSTYLESEL
NOVECTORFONTS
NOVERTFONTS
PRINTERFONTS
SCALABLEONLY
SCREENFONTS
SCRIPTSONLY
SELECTSCRIPT
SHOWHELP
TTONLY
USESTYLE
WYSIWYG
Fonttype options:
BOLDTYPE
ITALICTYPE
OPENTYPETYPE
PRINTERTYPE
REGULARTYPE
SCREENTYPE
SIMULATEDTYPE
TYPE1TYPE
----------------------------------------------------------------------------
Sun, 03 Jul 2005
New LAYER option, LAYER REGION, provides a clipping draw region for
objects in a layer. For instance:
drawregion @imageareax1 @imageareay1 @imageareax2 @imageareay2
imageput 50 75 example
This layer will be clipped in the same way:
layer testlay position 50 75
layer testlay region @imageareax1 @imageareay1 @imageareax2 @imageareay2
layer testlay image example
New command IMAGEREAD. Works just like IMAGELOAD except it returns the
image buffers, like this:
images = array(imageread(base1.jpg, base2.jpg, base3.jpg))
local imagebuf imageread(example.gif)
IMAGECOPY command now supports multiple destination buffers, so you can
make multiple copies of the same image, for instance:
imagecopy mainpage16 mainpage8 mainpage4 mainpage2 mainpage
pagesizex = mainpage->sizex
pagesizey = mainpage->sizey
imagesize @pagesizex/2 @pagesizey/2 32 mainpage2
imagesize @pagesizex/4 @pagesizey/4 32 mainpage4
imagesize @pagesizex/8 @pagesizey/8 32 mainpage8
imagesize @pagesizex/16 @pagesizey/16 32 mainpage16
----------------------------------------------------------------------------
Tue, 29 Jun 2005
Extensive error checking added to GIF load code.
SET ERRORLOAD now supported. When set to OFF, no error is generated by
a corrupt image file.
New error code passed to AGEDIT when loading a corrupt image file:
AGERROR_CORRUPTIMAGE -17
CORRUPTIMAGE errors are supported by PNG, GIF and JPEG load code.
drawclear white
set errorload off
imageload "W1K6LD.gif" test1 ; a corrupt GIF
imageload "W85DB.gif" test2 ; a corrupt GIF
imageload "box6.gif" test3 ; a normal GIF
imageput test3
; displays "0 0 1"
messagebox vardef(test1)$" "$vardef(test2)$" "$vardef(test3)
exitnow
----------------------------------------------------------------------------
Sun, 20 Jun 2005
New types supported for DLLSETUP
LENANDSTRINGARRAY int argc, char *argv[]
STRINGARRAYANDLEN char *argv[], int argc
STRINGARRAY char *argv[]
NULL always provides a NULL value, useful for parameters that
are always NULL like a CALLBACK address.
STRINGANDLEN char *string, int stringlen
LENANDSTRING int stringlen, char *string
WINHANDLE HWND hwnd - always provides @WINHANDLE
----------------------------------------------------------------------------
Thu, 16 Jun 2005
Long standing bug in GLOPEN which would create extra instances of the
GL filename, and of the GL tracking information fixed.
This would prevent the GL from ever closing completely. So you could
never delete, rename or write to a GL once you had ever used GLOPEN on it.
This also resulted in a minor memory leak when the GL filename would never
disappear if it was constructed (not a fixed name).
----------------------------------------------------------------------------
Wed, 01 Jun 2005
Bizarre text spacing on the 2nd (and later) page when using
HTML TEXT and some fonts, when printing is fixed.
----------------------------------------------------------------------------
Tue, 31 May 2005
Occasional crashes with '&' used in HTML text fixed.
----------------------------------------------------------------------------
Tue, 24 May 2005
New command IMAGEPOSTSCRIPT returns an image encoded as PostScript.
This only works with JPEG images loaded with the IMAGECOMPRESSED option.
Supports IMAGESPOTCOLOR as well.
RESULT = IMAGEPOSTSCRIPT(XPOS, YPOS, XSIZE, YSIZE, IMAGEBUF)
Runable example:
drawclear white
color black
set imagecompressed on
imageload sharptest.jpg
pshead = "%!PS-Adobe-3.0"$@crlf
fileput sharptest.ps @pshead$imagepostscript(0, 0, sharptest->sizex, sharptest->sizey, sharptest)
appshell open sharptest.ps ; will view with GSView or Acrobat
exitnow
RTF tags for quotes now support open and close, single and double quotes
using the extended ASCII characters (LATIN 1):
\lquote 145 Opening Single Quotation Mark
\rquote 146 Closing Single Quotation Mark
\ldblquote 147 Opening Double Quotation Mark
\rdblquote 148 Closing Double Quotation Mark
----------------------------------------------------------------------------
Sun, 15 May 2005
Four new String commands designed for comparing strings and extracting
the the differences or identical parts. All take the same parameters,
two or more strings.
SET STRINGRESULT STRDIFF(STRING1, STRING2, ...)
SET STRINGRESULT STRSAME(STRING1, STRING2, ...)
SET STRINGRESULT STRSAMEEND(STRING1, STRING2, ...)
SETS STARTPOS LENGTH SETSTRDIFFPOSITION(STRING1, STRING2, ...)
Example:
drawclear white
color black
str1 = "Hello There, this is not a test string, that is all"
str2 = "Hello There, this is a very test string, and that is all"
textln @quote$strdiff(@str1, @str2)$@quote ;"not a test string,"
sets pos len strdiffposition(@str1, @str2)
textln @pos$" "$@len ;22 18
textln @quote$strmid(@str1, strdiffposition(@str1, @str2))$@quote ;"not a test string,"
textln @quote$strdiff(@str2, @str1)$@quote ;"a very test string, and"
sets pos len strdiffposition(@str2, @str1)
textln @pos$" "$@len ;22 23
textln @quote$strmid(@str2, strdiffposition(@str2, @str1))$@quote ;"a very test string, and"
textln @quote$strsame(@str1, @str2)$@quote ;"Hello There, this is "
textln @quote$strsameend(@str1, @str2)$@quote ;" that is all"
forever
----------------------------------------------------------------------------
Tue, 10 May 2005
"mailto:" urls linked to in HTML text now use "appshell open" instead of
"netopenwebpage". This eliminates the extra browser window that was being
opened.
Color hi-lite on link words in HTML text is now done with a seperate color
stack instead of using the same stack as the tags to eliminate
interfering with other font/color changes.
Hack/Kludge to fix text color in HTML links when word wrapped just before
the link. It forces the text color back to black if the text color when
starting the link is already the link color. This is just to fix an
immediate problem, and will be fixed correctly soon.
----------------------------------------------------------------------------
Mon, 09 May 2005
Drastic changes to HTML parsing code required to allow HTML
code to be stuff back into the stream of HTML being parsed. This
allows the tag to use the symbol font to display bullets.
There is a strong likelyhood of new bugs in HTML support because
of these extensive changes.
STRREPLACE now supports multiple search/replace pairs of strings.
All the search/replace operations are done in a single pass, so
for instance:
strreplace("Hello John", "Jo", "Joe", "John", "Ed") gives "Hello Joehn"
strreplace("Hello John", "John", "Ed", "Jo", "Joe") gives "Hello Ed"
strreplace("Hello John", "Jo", "Zoe", "Zoe", "Ed") gives "Hello Zoehn"
Runable test:
windowsize 800 600
drawclear white
color black
textln strreplace("Hello John", "Jo", "Joe", "John", "Ed")$" Hello Joehn"
textln strreplace("Hello John", "John", "Ed", "Jo", "Joe")$" Hello Ed"
textln strreplace("Hello John", "Jo", "Zoe", "Zoe", "Ed")$" Hello Zoehn"
forever
An unlimited number of search/replace pairs are supported.
The performance of using a single STRREPLACE instead of a a series
of multiple STRREPLACE statements is dramaticly faster, particularly
with large source strings (a megabyte or more).
----------------------------------------------------------------------------
Tue, 03 May 2005
A new command and new element (for images). Used for printing color separations
with spot colors. Only works with CMYK JPEG images loaded with
IMAGECOMPRESSED ON.
IMAGEBUF->SPOTCOLOR ; returns color names and values
IMAGESPOTCOLOR IMAGEBUF "Spot Color Name" CYAN MAGENTA YELLOW BLACK ...
CYAN MAGENTA YELLOW and BLACK are from 0 to 1, floating point values,
PostScript style.
Up to four spot colors can be specified. First replaces CYAN channel,
Second replaces the MAGENTA channel and so on.
Unfortunately Photoshop won't let you save a custom channel
image as JPEG (where you can actually see the spot colors displayed
correctly in Photoshop). You have to cut/paste each channel into a new
CMYK image, and then save that as JPEG.
Example:
set imagecompressed on
imageload ibmlogo_cmyk.jpg
imagespotcolor ibmlogo_cmyk "PANTONE 299 CVC" 0.87 0.18 0 0
imagesize 10pct 12pct ibmlogo_cmyk
imageput 30pct 43pct ibmlogo_cmyk
----------------------------------------------------------------------------
Tue, 26 Apr 2005
HTMLTEXT enhanced:
tags now support urls with "mailto:"
tag supported, identical to tag
tag supported, creates strikeout font
tag supported, creates subscript font
tag supported, creates superscritpt font
Font name suffixes for fonts created by HTMLTEXT are
as follows (and are added in this order, so bold italic
font would have a suffix of "bi"):
b Bold
i Italic
u Underline
s Strikeout
sub Subscript
sup Superscript
Simple example:
windowsize 800 600
drawclear white
set texthtml on
text "Hello Strong Emphasis Strikeout
SubScript SuperScript"
forever
----------------------------------------------------------------------------
Mon, 25 Apr 2005
HTMLTEXT now supports the and tags.
----------------------------------------------------------------------------
Thu, 21 Apr 2005
New command line option, /SET:VARNAME=VALUE,VARNAME=VALUE...
works on any EXE build with AfterGRASP.
Supports system variables, as well as user variables.
Supports ON/OFF/STEP/TRUE/FALSE, just like in compiled scripts.
Supports quotes for values with spaces, and to preserve
upper/lowercase
Values not in quotes are converted to lowercase
If no value is given, the default will be whatever is
expected by that command. So for instance /set:debug
will turn debug on.
/SET can be used anywhere on the command line, and
will disappear as far as the running script is concerned.
The /SET option and values will not be visible in the
@COMMANDLINE system variable, or in the initial values of
@1, @2, @3, @4 (command line parameters).
/SET is limited to 100 variable name/variable value pairs.
Any more than that, and the additional /SETs will be ignored
(but still removed from the command line).
Each set is done in the order written to the command line,
any successive set will replace the first set.
Numbers, including floating point (but not with exponents)
are valid for the value.
Expressions (including measurements) and other variables are
not supported. So 21in or 5+8 or @fred are invalid values.
Sets of user variables are done exactly as if done with the
SET script command. You cannot create local, global or
common variables with /SET.
Examples:
testprogram.exe /set:debug, variables, startname="John Bridges"
testprogram.exe /set:debug,variables,startname="John Bridges"
testprogram.exe /set:debug /set:variables /set:startname="John Bridges"
testprogram.exe /set:debug,variables /set:startname="John Bridges"
agplay.exe /set:debug=on startup.agc /set:errormessage=off
agplay.exe startup.agc /set:errormessage=off
agplay.exe /set:errormessage=off startup.agc
----------------------------------------------------------------------------
Tue, 19 Apr 2005
FONTGAPS when used with DRAWOFFSET is fixed.
FONTSHADOW, TEXTFIT, TEXTHEIGHT, TEXTLINES now all support measurements
(like 50pct, or 2mm) for width/height (X/Y) values.
----------------------------------------------------------------------------
Mon, 18 Apr 2005
WINDOWSIZE and WINDOWPOSITION were forcing a default window to be
created, Fixed.
----------------------------------------------------------------------------
Sun, 17 Apr 2005
*WARNING* This build has a very large number of source changes (over
60 source files, hundreds of lines of code modified). Although I've
double checked most of the changes, it's quite possible there are new
(minor) bugs in this build. For instance in reviewing the code
today, I found 6 mistakes I made yesterday.
DRAWOFFSET now fully supported by all commands that take coordinates.
DRAWOFFSET
DRAWOFFSET XOFFSET YOFFSET
DRAWOFFSET X1 Y1 X2 Y2
DRAWOFFSET works much like DRAWREGION except all coordinates and
percentages are modified relative to the Drawing offset. So
for instance:
drawoffset 50 100
drawrect 100 100 200 200
would actually draw a rectangle at the real coordinates
of 150 200 250 300
DRAWOFFSET now has four parameters allowing you to create a virtual
smaller virtual window like this:
windowsize 800 600
drawclear white
color black
textsizetest
drawoffset (800-640)/2 (600-480)/2 640size 480size
color green
textsizetest
drawoffset (800-320)/2 (600-240)/2 320size 240size
color red
textsizetest
forever
textsizetest:
for i from 5 to 13 step 1
winfont "Times" "Times" 0 topercentage(@i) 90
text "Times "$@i$"pct"
fontdefine "Times" "Times" 0 topercentage(@i) 90
textln 50pct @textposy "Times "$@i$"pt"
next
return
Virtually all drawing commands now support measurements (I had to
made sure all of them use the GetX/GetY coordinate code internally
so that DRAWOFFSET would work with all commands). Also any command
that takes a size that is not a coordinate, such as the size of
a new image buffer, or the radius for a circle uses new code that
doesn't offset the value, but does take into account the virtual
width (set via the later 2 parameters to DRAWOFFSET).
----------------------------------------------------------------------------
Wed, 13 Apr 2005
IMAGESIZE command now resizes the Image Mask if one was set before using
IMAGESIZE. Previously the Image Mask was lost.
IMAGESIZE now works on JPEG images loaded with IMAGECOMPRESSED ON
(was bug in printer image injection code not using the original
image size).
----------------------------------------------------------------------------
Mon, 11 Apr 2005
New system variable:
SET IMAGEREGIONMASK ON/OFF ; defaults to ON
When putting images to a printer that have an IMAGEMASK, normally
a windows region (HRGN) is generated by scanning the IMAGEMASK. But
there is a serious buf in some Windows printer drivers when converting
the HRGN into a clipping path used on PostScript and some other printers.
The Printer Driver will accidently subtract 1 from the upper left hand
corner of all the rectangles in a HRGN causing a 1 pixel ring to appear
in the left and top of a masked IMAGEPUT.
When you SET IMAGEREGIONMASK OFF, the HRGN generating code is
bypassed to use code that breaks an image into short segments putup
one at a time. This method may produce odd striped artifacts on some
output devices so it is not the default.
----------------------------------------------------------------------------
Wed, 06 Apr 2005
IMAGEIMAGEDISTANCE when the images don't overlap is sped up (area calculation
is eliminated in more cases).
More optimizations to IMAGEIMAGEDISTANCE to reduce the number of
redundant point searches. If a point is more distance than the area
that surrounds an image, no search is done.
IMAGEIMAGEDISTANCE now has an optional parameter, a minimum distance. If
given, then the distance calculation is avoided if the crude distance
(calculated by the rectanglular area of the image) is larger than
the minimum distance.
----------------------------------------------------------------------------
Tue, 05 Apr 2005
All POSITION commands changed to no longer support variable names
for the results. You must now use the SETS command to get the
results.
All POSITION commands now support optional ADDX/ADDY parameters which
are values to add to the final position. Useful for sliding objects along
the edge of another object while still maintaining the same distance.
ADDX and ADDY are floating point values, and can be measurements
or percentages as well as plain numbers.
SETS XPOS YPOS POSITIONBOXBOX(XPOS1, YPOS1, BOXWIDTH1, BOXHEIGHT1, BOXWIDTH2, BOXHEIGHT2, ANGLE, DISTANCE, ADDX, ADDY)
SETS XPOS YPOS POSITIONBOXPOINT(XPOS1, YPOS1, BOXWIDTH, BOXHEIGHT, ANGLE, DISTANCE, ADDX, ADDY)
SETS XPOS YPOS POSITIONCIRCLEBOX(XCENT, YCENT, RADIUSX, RADIUSY, BOXWIDTH, BOXHEIGHT, ANGLE, DISTANCE, ADDX, ADDY)
SETS XPOS YPOS POSITIONCIRCLECIRCLE(XCENT, YCENT, RADIUSX1, RADIUSY1, RADIUSX2, RADIUSY2, ANGLE, DISTANCE, ADDX, ADDY)
SETS XPOS YPOS POSITIONCIRCLEPOINT(XCENT, YCENT, RADIUSX, RADIUSY, ANGLE, DISTANCE, ADDX, ADDY)
SETS XPOS YPOS POSITIONIMAGEBOX( IMGXPOS, IMGYPOS, IMAGEBUF, BOXWIDTH, BOXHEIGHT, ANGLE, DISTANCE, ADDX, ADDY)
SETS XPOS YPOS POSITIONIMAGECIRCLE( IMGXPOS, IMGYPOS, IMAGEBUF, RADIUSX, RADIUSY, ANGLE, DISTANCE, ADDX, ADDY)
SETS XPOS YPOS POSITIONIMAGEIMAGE( IMGXPOS, IMGYPOS, IMAGEBUF1, IMAGEBUF2, ANGLE, DISTANCE, ADDX, ADDY)
SETS XPOS YPOS POSITIONIMAGEPOINT( IMGXPOS, IMGYPOS, IMAGEBUF, ANGLE, DISTANCE, ADDX, ADDY)
----------------------------------------------------------------------------
Sun, 03 Apr 2005
New command PRINTINJECT designed for use with PostScript printing, it
will inject 1 or more strings into the PostScript stream. Useful for
complex PostScript commands (like CMYK drawing). Each string passed
has a CR/LF appended to it when written to the postscript stream.
Example:
drawclear white
set mydpi 300
paperwidth = 1200
paperheight = 1200
mmperpixel = @mydpi/254.
printsettings dpi @mydpi papersize @paperwidth/@mmperpixel @paperheight/@mmperpixel
PDFfilename = "c:\\digi-pdf.pdf"
PSfilename = "c:\\digi-pdf.ps"
set printfilename @PSfilename
printstart
printstartpage
printset
printinject "1 .57 0 .02 setcmykcolor 0 0 300 100 rectfill"
printinject "0 0 0 1 setcmykcolor 200 200 500 600 rectfill"
imageset
printendpage
printend
appexec "c:\\gs\\gs8.14\\bin\\gswin32c.exe" "-sDEVICE=pdfwrite -q -dPDFSETTINGS=/ebook -dCompatibilityLevel=1.3 -dNOPAUSE -dBATCH -sOutputFile="$@quote$@PDFfilename$@quote$" -c save pop -f "$@quote$@PSfilename$@quote
exitnow
----------------------------------------------------------------------------
Thu, 31 Mar 2005
IMAGEPOINTDISTANCE had bugs in it's search for starting point fixed,
this also made IMAGEIMAGEDISTANCE and IMAGEIMAGEPOSITION incorrect.
IMAGEFINDEDGE is now doubled in speed (was scanning edges twice as
far as required).
IMAGEFINDEDGE was not working on images that were very wide or tall,
fixed.
Code inside IMAGEPOINTDISTANCE (used by numerous other functions) fixed
to return the correct coordinates when the point is closest on the Y
axis.
Images with a mask (IMAGEMASKSET, or IMAGETRAN) were not clipping near
the edge of the window correctly on Win2000/WinXP machines. A bug
in the MaskBlt API call. Calls to MaskBlt have been removed to fix it.
Fixed crashing bug in IMAGEFINDEDGE/IMAGEFINDEDGES when the source image has
no bitmask (and one in generated with the current TRAN color).
All -> operators that work on images are updated to handle images
that are part of an array.
DRAWOFFSET is now supported, takes X and Y values including measurements,
default is 0,0 (no offset).
Only commands (so far) which support DRAWOFFSET are:
DRAWPOLYGON
DRAWPOLYGONFILLED
I've been using DRAWOFFSET it to test IMAGEFINDEDGES by using DRAWPOLYGON
to show the edges that were found.
----------------------------------------------------------------------------
Mon, 28 Mar 2005
IMAGESET and PRINTSET rewrittten to be nestable up to 64 levels deep.
For instance now you can do complex image building operations with IMAGESET
from within a block of code that is drawing to a printer with PRINTSET.
----------------------------------------------------------------------------
Wed, 23 Mar 2005
Updated agcmd.dat, agele.dat and agvar.dat to be fully up to date
(they are used by AfterGRASP Editor).
Finished coding of:
DISTANCECIRCLEPOINT
DISTANCEBOXPOINT
POSITIONIMAGEPOINT
POSITIONCIRCLEPOINT
POSITIONBOXPOINT
Syntax for POINT based DISTANCE and POSITION commands is:
SETS RESULTX RESULTY POSITIONBOXPOINT(CENTX CENTY RADIUSX RADIUSY ANGLE DISTANCE)
POSITIONBOXPOINT CENTX CENTY RADIUSX RADIUSY ANGLE DISTANCE RESULTX RESULTY
RESULT = DISTANCEBOXPOINT(CENTX CENTY RADIUSX RADIUSY XPOS2 YPOS2)
SETS RESULTX RESULTY POSITIONCIRCLEPOINT(XPOS1 YPOS1 BOXWIDTH BOXHEIGHT ANGLE DISTANCE)
POSITIONCIRCLEPOINT XPOS1 YPOS1 BOXWIDTH BOXHEIGHT ANGLE DISTANCE RESULTX RESULTY
RESULT = DISTANCECIRCLEPOINT(XPOS1 YPOS1 BOXWIDTH BOXHEIGHT XPOS2 YPOS2)
SETS RESULTX RESULTY POSITIONIMAGEPOINT(IMGXPOS IMGYPOS IMAGE ANGLE DISTANCE)
POSITIONIMAGEPOINT IMGXPOS IMGYPOS IMAGE ANGLE DISTANCE RESULTX RESULTY
RESULT = DISTANCEIMAGEPOINT(IMGXPOS IMGYPOS IMAGE XPOS YPOS)
----------------------------------------------------------------------------
Tue, 22 Mar 2005
WindowSize limit of no smaller than 32x32 is removed, you can now
create a window as small as 1x1. Any size smaller than 1 is
changed to 1.
6 New elements for images:
->EdgeAverageX
->EdgeAverageY
->EdgeCenterX
->EdgeCenterY
->EdgeRadiusX
->EdgeRadiusY
EDGEAVERAGEX/EDGEAVERAGEY is set by IMAGEFINDEDGES, it's the average of
all the edge coordinates, an approximate center point.
EDGECENTERX/EDGECENTERY is set by IMAGEFINDEDGE, it's center point of
a circle that is closest fit to the edge of the image.
EDGERADIUSX/EDGERADIUSY is set by IMAGEFINDEDGE, it's x/y radius of
the circle that is the closest fit to the edge of the image.
6 New commands added:
DISTANCEIMAGEPOINT
DISTANCECIRCLEPOINT
DISTANCEBOXPOINT
POSITIONIMAGEPOINT
POSITIONCIRCLEPOINT
POSITIONBOXPOINT
All 6 are still under development except DISTANCEIMAGEPOINT which
is finished.
----------------------------------------------------------------------------
Thu, 17 Mar 2005
IMAGEFINDEDGE is dramaticly improved for irregular shapes, it finds a
much tighter circle. Unfortunately this means it's slower.
DISTANCEBOXBOX was giving incorrect results (the square root of the
real results).
POSITIONBOXBOX was giving often incorrect results because it depends
on the code that was incorrect in DISTANCEBOXBOX.
DISTANCECIRCLEBOX is now more accurate (measures against box sides,
not just corners).
DISTANCEIMAGECIRCLE and POSITIONIMAGECIRCLE both coded and working.
DISTANCEIMAGEIMAGE and POSITIONIMAGEIMAGE written. Need further
testing.
DISTANCEIMAGEIMAGE and POSITIONIMAGEIMAGE fall through to worst cases
if less edge information is available. So for instance:
DISTANCEIMAGEIMAGE only uses full comparison code if
IMAGEFINDEDGES was done on both images. Otherise:
IMAGEFINDEDGES on one and IMAGEFINDEDGE on the other, it
uses DISTANCEIMAGECIRCLE code.
IMAGEFINDEDGE on both images, it uses DISTANCECIRCLECIRCLE code.
IMAGEFINDEDGE on one image, nothing on the other, it uses
DISTANCECIRCLEBOX code.
No edge detection done on either image, it uses DISTANCEBOXBOX code.
----------------------------------------------------------------------------
Mon, 14 Mar 2005
IMAGEFINDEDGES has some unusual cases fixed, was ending the edge
search early in a deep crevasse. Example I used to detect error:
drawclear white
imageload bic3.jpg test
imageflood test pkgmask top left 4
imagemaskset test pkgmask
imagefree pkgmask
imagefindedges test
color black
drawpolygonfilled array(test->edgecounts) test->edges
color green
drawpolygon array(test->edgecounts) test->edges 2
set textwrap off
color black
drawregion 50pct 0 100pct 100pct
textln @textposx @textposy test->edgecounts
forever
DRAWPOLYGON and DRAWPOLYGONFILLED now support an optional first
parameter that is an array of coordinate counts. This allows
drawing multiple polygons with a single command, and helps
when using IMAGE->EDGE. For example:
drawclear white
imagetran on white
color red
drawcirclefilled 200 200 100 150
drawcirclefilled 400 300 100 150
color white
drawcirclefilled 320 250 190 120
imageget test
imagefindedges test
color black
drawpolygonfilled array(test->edgecounts) test->edges
color green
drawpolygon array(test->edgecounts) test->edges 2
set textwrap off
textln 0,0 test->edgecounts
forever
----------------------------------------------------------------------------
Sun, 13 Mar 2005
DRAWINSIDE now supports the size suffix. For example:
if drawinside(100, 100, 100size, 200size, @xpos, ypos)
...
endif
Renamed all POSITION and DISTANCE calculation commands to use the prefix
POSITION/DISTANCE instead of a suffix:
DISTANCECIRCLEBOX
DISTANCECIRCLECIRCLE
DISTANCEIMAGEBOX
POSITIONCIRCLEBOX
POSITIONCIRCLECIRCLE
POSITIONIMAGEBOX
The following are still not finished (under development):
POSITIONIMAGECIRCLE
POSITIONIMAGEIMAGE
DISTANCEIMAGECIRCLE
DISTANCEIMAGEIMAGE
Five new commands:
POSITIONBOXBOX
DISTANCEBOXBOX
DRAWFITBOX
DRAWFITCIRCLE
DRAWFITIMAGE
Syntax is:
SETS RESULTX RESULTY POSITIONBOXBOX(XPOS1 YPOS1 BOXWIDTH1 BOXHEIGHT1 BOXWIDTH2 BOXHEIGHT2 ANGLE DISTANCE)
POSITIONBOXBOX XPOS1 YPOS1 BOXWIDTH1 BOXHEIGHT1 BOXWIDTH2 BOXHEIGHT2 ANGLE DISTANCE RESULTX RESULTY
RESULT = DISTANCEBOXBOX(XPOS1 YPOS1 BOXWIDTH1 BOXHEIGHT1 XPOS2 YPOS2 BOXWIDTH2 BOXHEIGHT2)
RESULT = DRAWFITBOX(X1 Y1 X2 Y2)
RESULT = DRAWFITCIRCLE(XCENT YCENT XRADIUS YRADIUS)
RESULT = DRAWFITIMAGE(XPOS YPOS IMAGE)
AGCMD.DAT updated with renamed commands and new commands.
Runable example using DRAWFITBOX, DISTANCEBOXBOX (and other POSITON/DISTANCE
commands):
windowsize 980 700
drawclear red
imagetran on white
imageload logo.gif
set textwrap off
images = array(bic1.jpg, bic2.jpg, bic3.jpg, bic4.jpg, bic5.jpg, bic6.jpg)
xposlist = array(0, 400, 0, 400, 0, 400)
yposlist = array(150, 150, 350, 350, 550, 550)
color white
set floatdegrees on
for type from 0 to 1
for i from 0 count images->size
distlist[@i] = -999999
textlist[@i] = randwordsW(random(1,4),7)
widthlist[@i] = textwidth(@textlist[@i])
heightlist[@i] = textheight(@textlist[@i])
imageload @images[@i]
imagesize 20pct 20pct @images[@i]
imageflood @images[@i] pkgmask top left 4 ; 4 percent off color allowed
imageflood @images[@i] pkgmask top right 4
imageflood @images[@i] pkgmask bottom left 4
imageflood @images[@i] pkgmask bottom right 4
imagemaskset @images[@i] pkgmask
imagefree pkgmask
if @type
imagefindedges @images[@i]
else
imagefindedge @images[@i]
endif
imageput @xposlist[@i] @yposlist[@i] @images[@i]
next
for i from 0 count images->size
for angle from 5 to 115 step 1
sets xbox ybox positionimagebox(@xposlist[@i] @yposlist[@i] @images[@i] @widthlist[@i] @heightlist[@i] @angle 8)
layer test$@i position @xbox @ybox text @textlist[@i]
layer test$@i box -3 -3 @widthlist[@i]+2 @heightlist[@i]+2 3
dist = 99999
drawregion
if drawfitbox(@xbox-6, @ybox-6, (@widthlist[@i]+12)size, (@heightlist[@i]+12)size)
for j from 0 to @i
if @j==@i continue
newdist = distanceboxbox(@xboxpos[@j] @yboxpos[@j], @widthlist[@j] @heightlist[@j], @xbox, @ybox, @widthlist[@i], @heightlist[@i])
if @dist<0
if @newdist<0
inc dist @newdist
endif
else
if @newdist<@dist
dist = @newdist
endif
endif
next
for j from 0 count images->size
if @j==@i continue
newdist = distanceimagebox(@xposlist[@j] @yposlist[@j], @images[@j], @xbox, @ybox, @widthlist[@i], @heightlist[@i])
if @dist<0
if @newdist<0
inc dist @newdist
endif
else
if @newdist<@dist
dist = @newdist
endif
endif
next
if @dist>@distlist[@i]
distlist[@i] = @dist
bestangle[@i] = @angle
endif
endif
next
sets xboxpos[@i] yboxpos[@i] positionimagebox(@xposlist[@i] @yposlist[@i] @images[@i] @widthlist[@i] @heightlist[@i] @bestangle[@i] 8)
layer test$@i position @xboxpos[@i] @yboxpos[@i]
next
delay 200
next
wait
exitnow
randwordsW:
declare linecount wordcount
lines = ""
for @linecount
words = ""
for random(4,@wordcount)
word = strchr(random(0,25)+strasc("A"))
for random(0,8)
word = @word$strchr(random(0,25)+strasc("a"))
next
words = @words$@word$" "
next
lines = @lines$@words$@crlf
next
return @lines
----------------------------------------------------------------------------
Thu, 10 Mar 2005
Removed all REGION code for calculating whether a point is inside an
image scanned with IMAGEFINDEDGES. Now generates a mask image instead.
Turns out Windows REGION code is quite slow and memory hungry, so
it had to be removed. This also fixes the numerous problems
with the overlap percentage code in IMAGEBOXPOSITION that were
causing it to always return 0 for the overlap percentage.
Created new crawling tables for IMAGEFINDEDGES to fix problems with
irregular edges.
In IMAGEFINDEDGES replaced code which keeps track of what areas
have been scaned with slower list based code. This fixes problems
with images that have sharp points, and narrow sections (1 pixel
wide).
New code to search for pixel distance against IMAGEFINDEDGES, uses
sorted X/Y lists of edge points. Will be used in IMAGEIMAGEPOSITION
and IMAGEIMAGEDISTANCE (not yet written).
----------------------------------------------------------------------------
Tue, 08 Mar 2005
IMAGEBOXPOSITION/IMAGEBOXDISTANCE are drasticly sped up, around 50x faster
than yesterday's build. They now calculate based on line segments rather
than single pixels. Also the monte carlo style percentage of overlap code
in IMAGEBOXDISTANCE is much smarter, and doesn't try the test if there is
absolutely no overlap.
If IMAGEBOXPOSTION and IMAGEBOXDISTANCE are used with IMAGEFINDEDGE instead
of IMAGEFINDEDGES, the CIRCLEBOXPOSITION and CIRCLEBOXDISTANCE code is used.
This allows either the circle scan method or exact edge method to be used by
just changing the single call to IMAGEFINDEDGE/IMAGEFINDEDGES.
Runable example that uses both styles of edge following:
windowsize 900 700
drawclear red
imagetran on white
imageload logo.gif
set textwrap off
images = array(logo.gif, logo.gif, logo.gif, logo.gif, logo.gif, logo.gif)
xposlist = array(0, 400, 0, 400, 0, 400)
yposlist = array(150, 150, 350, 350, 550, 550)
color white
set floatdegrees on
for type from 0 to 1
for i from 0 count images->size
distlist[@i] = -999999
textlist[@i] = randwordsW(random(1,4))
widthlist[@i] = textwidth(@textlist[@i])
heightlist[@i] = textheight(@textlist[@i])
if @type
imagefindedges @images[@i]
else
imagefindedge @images[@i]
endif
imageput @xposlist[@i] @yposlist[@i] @images[@i]
next
for angle from 15 to 115 step 1
for i from 0 count images->size
sets xbox ybox imageboxposition(@xposlist[@i] @yposlist[@i] @images[@i] @widthlist[@i] @heightlist[@i] @angle 8)
layer test$@i position @xbox @ybox text @textlist[@i]
layer test$@i box -3 -3 @widthlist[@i]+2 @heightlist[@i]+2 3
dist = 99999
for j from 0 count images->size
if @j==@i continue
newdist = imageboxdistance(@xposlist[@j] @yposlist[@j], @images[@j], @xbox, @ybox, @widthlist[@i], @heightlist[@i])
if @dist<0
if @newdist<0
inc dist @newdist
endif
else
if @newdist<@dist
dist = @newdist
endif
endif
next
if @distlist[@i]<@dist
distlist[@i] = @dist
bestangle[@i] = @angle
endif
next
next
for i from 0 count images->size
sets xbox ybox imageboxposition(@xposlist[@i] @yposlist[@i] @images[@i] @widthlist[@i] @heightlist[@i] @bestangle[@i] 8)
layer test$@i position @xbox @ybox
next
next
wait
exitnow
randwordsW:
declare linecount
lines = ""
for @linecount
words = ""
for random(4,7)
word = strchr(random(0,25)+strasc("A"))
for random(0,6)
word = @word$strchr(random(0,25)+strasc("a"))
next
words = @words$@word$" "
next
lines = @lines$@words$@crlf
next
return @lines
----------------------------------------------------------------------------
Mon, 07 Mar 2005
Several filled drawing functions were off by one pixel (or less) on the
right hand side of the shape being drawn. This includes:
DRAWPOLYGONFILLED
DRAWCIRCLEFILLED
DRAWRECTROUND
DRAWANTIPOLYGONFILLED
DRAWANTICIRCLEFILLED
DRAWANTIRECTROUND
All fixed.
IMAGEFINDEDGES now handles images that touch the edges (was
crashing and generating incorrect coordinates).
IMAGEFINDEDGES now scans all four sides of the image for start
points to search from.
IMAGEFINDEDGES now stores an average of all edgepoints to be
used as a center point in IMAGEBOXPOSITION, IMAGECIRCLEPOSITION
and IMAGEIMAGEPOSITION.
IMAGEFINDEDGE now stores the centerpoint and radius X/Y in the
imagebuffer for future use.
IMAGEBOXPOSITION and IMAGEBOXDISTANCE both in place and working.
This first version of IMAGEBOXPOSITION is extremely slow (EXTREMELY!)
----------------------------------------------------------------------------
Thu, 03 Mar 2005
LAYER HIDE when a layer contains a RECT, BOX, BOXROUND or RECTROUND is
fixed (it wasn't hiding).
LAYER TEXT when used LAYER RECT or other drawing commands would have
the right hand edge of the text shifted, left or right depending on
the start point of the drawing command. Fixed.
New commands:
IMAGEFINDEDGES IMAGEBUF
Searches an image's mask to create a list of edge
coordinates for each region of the image. Accepts one
or more images. Will add an imagemask if none is defined.
IMAGE->EDGES
Provides a list of coordinates for all the images found within
an image after using the IMAGEFINDEDGES command
IMAGE->EDGECOUNTS
Provides a list of counts, the number of coordinates for each
area in an image after using IMAGEFINDEDGES. On simple images
(one with only a single area) this is a single number that is
the number of coordinate pairs returned by IMAGE->EDGES.
Simple example:
drawclear white
imagetran on white
color red
drawcirclefilled 200 200 100 150
color blue
drawcirclefilled 320 250 190 120
color green
drawcirclefilled 520 350 110 120
imageget test
imagefindedges test
color black
drawpolygonfilled test->edges
textln test->edgecounts
forever
The PRINTENDPAGE command now puts a small for non-commercial use message at
the corners of a page (much like the message that is displayed at the end
of an application).
New commands still under development (not working yet):
IMAGECIRCLEDISTANCE
IMAGECIRCLEPOSITION
IMAGEBOXDISTANCE
IMAGEBOXPOSITION
IMAGEIMAGEDISTANCE
IMAGEIMAGEPOSITION
DISTANCE = IMAGECIRCLEDISTANCE(XPOS, YPOS, IMAGEBUF, XCENT, YCENT, XRADIUS, YRADIUS)
SETS XPOS YPOS IMAGECIRCLEPOSITION(XPOS, YPOS, IMAGEBUF, XCENT, YCENT, XRADIUS, YRADIUS, ANGLE DISTANCE)
IMAGECIRCLEPOSITION XPOS YPOS IMAGEBUF XCENT YCENT XRADIUS YRADIUS ANGLE DISTANCE XRESULT YRESULT
DISTANCE = IMAGEBOXDISTANCE(XPOS, YPOS, IMAGEBUF, X1, Y1, X2, Y2)
SETS XPOS YPOS IMAGEBOXPOSITION(XPOS, YPOS, IMAGEBUF, X1, Y1, X2, Y2, ANGLE DISTANCE)
IMAGEBOXPOSITION XPOS YPOS IMAGEBUF X1 Y1 X2 Y2 ANGLE DISTANCE XRESULT YRESULT
DISTANCE = IMAGEIMAGEDISTANCE(XPOS1, YPOS1, IMAGEBUF1, XPOS2, YPOS2, IMAGEBUF712)
SETS XPOS YPOS IMAGEIMAGEPOSITION(XPOS1, YPOS1, IMAGEBUF1, XPOS2, YPOS2, IMAGEBUF2, ANGLE DISTANCE)
IMAGEIMAGEPOSITION XPOS1 YPOS1 IMAGEBUF1 XPOS2 YPOS2 IMAGEBUF2 ANGLE DISTANCE XRESULT YRESULT
----------------------------------------------------------------------------
Thu, 24 Feb 2005
Small compiler changes for IMAGEFLIPX IMAGEFLIPY and DRAWBOXROUND, to remove
redundant handling of return values (none of those commands ever return anything).
DRAWCLIPX and DRAWCLIPY commands are now supported.
New suffix operators function much like pts, mm, and other suffix operators.
pixels same as pixelsx
pixelsx value in pixels relative to X axis
pixelsy value in pixels relative to Y axis
size value added to previous X/Y axis value
All have functions that can be called to get the same result:
toPIXELS(N) same as Npixels
toPIXELSX(N) same as Npixelsx
toPIXELSY(N) same as Npixelsy
toSIZE(N) same as Nsize
Examples:
drawregion 100 100 200size 150size
imageput 10pct 20pct test (20pct)size (30pct)size
xpos = (10pct)pixelsx
ypos = (20pct)pixelsy
Commands which support toSIZE:
drawantibox
drawantiboxround
drawantiline
drawantipolygon
drawantipolygonfilled
drawantirect
drawantirectround
drawbox
drawboxround
drawline
drawpolygon
drawpolygonfilled
drawrect
drawrectround
drawregion
imageput
imagealphaset
For commands which accept multiple coordinates (drawline, drawpolygon, and so on),
each coordinateis relative to the previous coordinate. So for instance:
drawline 0 0 50size 50size -20size -50size
Is the same as
drawline 0 0 149 149 130 100
Bug in text display and formatting when a drawregion is too small to fit
even a single character was causing a hang. Fixed.
Fixed serious memory bug when reading string system variables that are given
a new value such as:
set glprodirectory "Hello"
text @glprodirectory
text @glprodirectory
text @glprodirectory
text @glprodirectory
scriptlink pdfgen
----------------------------------------------------------------------------
Sun, 20 Feb 2005
IMAGEPUT with a Masked image has all new code to not use MASKBLT on
non-memory accessable devices (like printers). If possible (if the
printer supports it), it uses complex regions to simulate the mask,
otherwise it breaks the bitmap into little pieces to similate the masked
IMAGEPUT.
The REGION based code for IMAGEPUT masked is quite slow, but produces
the highest quality results with the smallest output filesize (when
dealing with PostScript or PDF).
Working example of printing with a masked image:
drawclear white
set mydpi 300
; how many pixels per 1/10th of a MM
mmperpixel = @mydpi/254.
paperwidth = 1200
paperheight = 1200
printsettings dpi @mydpi papersize @paperwidth/@mmperpixel @paperheight/@mmperpixel
PDFfilename = "c:\\digi-pdf.pdf"
PSfilename = "c:\\digi-pdf.ps"
set printfilename @PSfilename
imagetran on white
imagenew masktest @paperwidth @paperheight
imageset masktest
drawclear white
color yellow
fontdefine arial 150
text "1234567890"
imageset
imagetran off
printstart
printstartpage
printset
color blue
drawboxround 0 0 @drawmaxx @drawmaxy 9pct
color black
drawboxround 10pct 10pct @drawmaxx-10pct @drawmaxy-10pct 9pct
color red
drawboxround 20pct 20pct @drawmaxx-20pct @drawmaxy-20pct 9pct
color green
drawboxround 30pct 30pct @drawmaxx-30pct @drawmaxy-30pct 9pct
imageput masktest
imageflipx masktest
imageflipy masktest
imageput masktest
imageset
printendpage
printend
appexec "c:\\gs\\gs8.14\\bin\\gswin32c.exe" "-sDEVICE=pdfwrite -q -dPDFSETTINGS=/ebook -dCompatibilityLevel=1.3 -dNOPAUSE -dBATCH -sOutputFile="$@quote$@PDFfilename$@quote$" -c save pop -f "$@quote$@PSfilename$@quote
exitnow
----------------------------------------------------------------------------
Thu, 17 Feb 2005 PM
In CIRCLEBOXDISTANCE when the circle and box are intersecting or overlapping
the result is no longer a distance (in previous build it was a negative
distance). It is now a negative floating point percentage of how much of
the box overlaps the circle. The percentage is an approximation done with
a montecarlo random sampling (500 points), so results will be slightly
different on repeated calls.
If comparing the overlap against multiple circles, I recommend adding
the negative percentages together rather than using the lowest (most
overlap). For example, from the placement of text example modified
to add the negative percentages together:
for angle from 5 to 105 step 1
for i from 0 count images->size
sets xbox ybox circleboxposition(@xcentlist[@i] @ycentlist[@i] @xradlist[@i] @yradlist[@i] @widthlist[@i] @heightlist[@i] @angle 8)
layer test$@i position @xbox @ybox text @textlist[@i]
layer test$@i box -3 -3 @widthlist[@i]+2 @heightlist[@i]+2 3
dist = 99999
for j from 0 count images->size
if @j==@i continue
newdist = circleboxdistance(@xcentlist[@j], @ycentlist[@j], @xradlist[@j], @yradlist[@j], @xbox, @ybox, @widthlist[@i], @heightlist[@i])
if @dist<0
if @newdist<0
inc dist @newdist
endif
else
if @newdist<@dist
dist = @newdist
endif
endif
next
if @distlist[@i]<@dist
distlist[@i] = @dist
bestangle[@i] = @angle
endif
next
next
See where it adds newdist to dist if the previous dist is negative.
----------------------------------------------------------------------------
Thu, 17 Feb 2005 AM
Four new commands for dealing with functions that return multiple values:
SETS LOCALS GLOBALS COMMONS
Syntax is:
SETS VARNAME1 [VARNAME2 ...] VALUE1 [VALUE2 ...]
LOCALS VARNAME1 [VARNAME2 ...] VALUE1 [VALUE2 ...]
GLOBALS VARNAME1 [VARNAME2 ...] VALUE1 [VALUE2 ...]
COMMONS VARNAME1 [VARNAME2 ...] VALUE1 [VALUE2 ...]
Each functions like the non-plural named version (LOCALS creates
local variables, GLOBALS creates global variables, and so on).
But instead of the variable name/values being interleaved,
varname, value, varname, value, varname, value. The variable
names are passed first, then the values.
Syntax Example:
drawclear white
sets w x y 5 6 7
sets a b c d examplesub(3)
sets i j k @d*@w+@a @d*@x+@b @d*@y+@c
set variables on
wait
exitnow
examplesub:
declare mul
return 1*@mul 2*@mul 3*@mul 4*@mul
IMAGEPUT now returns the final coordinates where an image was placed.
Example:
locals xpos ypos imageput(center, center, testimage.gif)
Working example using CIRCLEBOXPOSITION and SETS:
windowsize 900 700
drawclear red
imagetran on white
imageload logo.gif
set textwrap off
images = array(logo.gif, logo.gif, logo.gif, logo.gif, logo.gif, logo.gif)
xposlist = array(0, 400, 0, 400, 0, 400)
yposlist = array(150, 150, 350, 350, 550, 550)
color white
set floatdegrees on
for i from 0 count images->size
distlist[@i] = -999999
textlist[@i] = randwords(random(1,4))
widthlist[@i] = textwidth(@textlist[@i])
heightlist[@i] = textheight(@textlist[@i])
imagefindedge @images[@i] xpos ypos xrad yrad
xcentlist[@i] = @xpos+@xposlist[@i]
ycentlist[@i] = @ypos+@yposlist[@i]
xradlist[@i] = @xrad
yradlist[@i] = @yrad
imageput @xposlist[@i] @yposlist[@i] @images[@i]
drawcircle @xcentlist[@i] @ycentlist[@i] @xradlist[@i] @yradlist[@i] 2
next
for angle from 5 to 105 step 1
for i from 0 count images->size
sets xbox ybox circleboxposition(@xcentlist[@i] @ycentlist[@i] @xradlist[@i] @yradlist[@i] @widthlist[@i] @heightlist[@i] @angle 8)
layer test$@i position @xbox @ybox text @textlist[@i]
layer test$@i box -3 -3 @widthlist[@i]+2 @heightlist[@i]+2 3
dist = 99999
for j from 0 count images->size
if @j==@i continue
newdist = circleboxdistance(@xcentlist[@j], @ycentlist[@j], @xradlist[@j], @yradlist[@j], @xbox, @ybox, @widthlist[@i], @heightlist[@i])
if @newdist<@dist
dist = @newdist
endif
next
if @distlist[@i]<@dist
distlist[@i] = @dist
bestangle[@i] = @angle
endif
next
next
for i from 0 count images->size
sets xbox ybox circleboxposition(@xcentlist[@i] @ycentlist[@i] @xradlist[@i] @yradlist[@i] @widthlist[@i] @heightlist[@i] @bestangle[@i] 8)
layer test$@i position @xbox @ybox
next
wait
exitnow
----------------------------------------------------------------------------
Wed, 16 Feb 2005
HOTSPOT was dropping the roll over layer when you clicked on a hotspot.
Now it leaves it up until the mouse leaves the hotspot area.
CIRCLEBOXDISTANCE fixed, was giving the wrong answer half the time.
CIRCLEBOXDISTANCE how gives a negative value if the box overlaps
the circle.
CIRCLEBOXPOSITION and CIRCLECIRCLEPOSITION now base the angle on 0 being
the top of the circle, 90 being the right hand side, 180 being the bottom,
and 270 being the left hand side.
Updated runable example using CIRCLEBOXPOSITION, CIRCLEBOXDISTANCE and IMAGEFINDEDGE
windowsize 900 700
drawclear red
imagetran on white
imageload logo.gif
set textwrap off
images = array(logo.gif, logo.gif, logo.gif, logo.gif, logo.gif, logo.gif)
xposlist = array(0, 400, 0, 400, 0, 400)
yposlist = array(150, 150, 350, 350, 550, 550)
color white
set floatdegrees on
for i from 0 count images->size
distlist[@i] = -999999
textlist[@i] = randwords(random(1,4))
widthlist[@i] = textwidth(@textlist[@i])
heightlist[@i] = textheight(@textlist[@i])
imagefindedge @images[@i] xpos ypos xrad yrad
xcentlist[@i] = @xpos+@xposlist[@i]
ycentlist[@i] = @ypos+@yposlist[@i]
xradlist[@i] = @xrad
yradlist[@i] = @yrad
imageput @xposlist[@i] @yposlist[@i] @images[@i]
drawcircle @xcentlist[@i] @ycentlist[@i] @xradlist[@i] @yradlist[@i] 2
next
for angle from 5 to 105 step 1
for i from 0 count images->size
circleboxposition @xcentlist[@i] @ycentlist[@i] @xradlist[@i] @yradlist[@i] @widthlist[@i] @heightlist[@i] @angle 8 xbox ybox
layer test$@i position @xbox @ybox text @textlist[@i]
layer test$@i box -3 -3 @widthlist[@i]+2 @heightlist[@i]+2 3
dist = 99999
for j from 0 count images->size
if @j==@i continue
newdist = circleboxdistance(@xcentlist[@j], @ycentlist[@j], @xradlist[@j], @yradlist[@j], @xbox, @ybox, @widthlist[@i], @heightlist[@i])
if @newdist<@dist
dist = @newdist
endif
next
if @distlist[@i]<@dist
distlist[@i] = @dist
bestangle[@i] = @angle
endif
next
next
for i from 0 count images->size
circleboxposition @xcentlist[@i] @ycentlist[@i] @xradlist[@i] @yradlist[@i] @widthlist[@i] @heightlist[@i] @bestangle[@i] 8 xbox ybox
layer test$@i position @xbox @ybox
next
wait
exitnow
----------------------------------------------------------------------------
Tue, 15 Feb 2005
VECANGLE now accepts floating point values, previously it rounded
all values down to integer before doing the vector angle calculation.
Four new math oriented commands, all oriented twords calculations done
with circles (tied in with yesterdays IMAGEFINDEDGE command).
Together, you can use them to evenly place images and text, shifting
the position of text near an image to a different start point that is
furthest away from other images.
CIRCLECIRCLEDISTANCE finds the distance between the edge of two circles. You
pass it the center point, and X/Y radius for two circles.
RESULT = CIRCLECIRCLEDISTANCE(XCENT1, YCENT1, XRADIUS1, YRADIUS1, XCENT2, YCENT2, XRADIUS2, YRADIUS2)
CIRCLEBOXDISTANCE finds the distance from the edge of a circle to whichever corner of
a box that is closest. It determines the edge point on the circle based on the
angle between the closest box corner and the center of the circle, so the distance
may not be exactly as expected.
RESULT = CIRCLEBOXDISTANCE(XCENT, YCENT, RADIUSX, RADIUSY, XPOS, YPOS, BOXWIDTH, BOXHEIGHT)
CIRCLECIRCLEPOSITION calculates the center point for a circle that is touching
the edge of the circle who's center and radius are passed.
CIRCLECIRCLEPOSITION XCENT YCENT RADIUSX1 RADIUSY1 RADIUSX2 RADIUSY2 ANGLE DISTANCE RESULTX RESULTY
RESULT = ARRAY(CIRCLECIRCLEPOSITION(XCENT, YCENT, RADIUSX1, RADIUSY1, RADIUSX2, RADIUSY2, ANGLE, DISTANCE))
CIRCLEBOXPOSITION calculates the upper left hand corner of a box that is touching the
edge of the circle who's center and radius are passed. The angle is at what point
ont he circle's edge the box is to touch, and the distance is how far from the
circles edge to place the box (0 would be touching, -1 would be one pixel inside,
1 would be one pixel outside the circle).
CIRCLEBOXPOSITION XCENT YCENT RADIUSX RADIUSY BOXWIDTH BOXHEIGHT ANGLE DISTANCE RESULTX RESULTY
RESULT = ARRAY(CIRCLEBOXPOSITION(XCENT, YCENT, RADIUSX, RADIUSY, BOXWIDTH, BOXHEIGHT, ANGLE, DISTANCE))
You can call CIRCLEBOXPOSITION/CIRCLECIRCLEPOSITION as a command passing it the two variable
names for the resulting X and Y coordinates. Or call it as a function which returns
two values. Because of the difficulty in dealing with functions with multiple return
values, you normally would use CIRCLEBOXPOSITION as a command (not function).
Example of CIRCLEBOXPOSITION used with IMAGEFINDEDGE:
drawclear red
imagetran on white
imageload logo.gif example
imageput 300 300 example
color white
imagefindedge example xpos ypos xrad yrad
inc xpos 300
inc ypos 300
drawcircle @xpos @ypos @xrad @yrad 3
set textwrap off
teststr = "Hello there my name is fuddle,
be buddle, and we wuddle as
we muddle under the puddle that
is tuddle."
boxwidth = textwidth(@teststr)
boxheight = textheight(@teststr)
set floatdegrees on
color green
layer testing text @teststr
layer testing box -3 -3 @boxwidth+2 @boxheight+2 3
for angle from 0 to 360 step .02
circleboxposition @xpos @ypos @xrad @yrad @boxwidth @boxheight @angle 0 xbox ybox
layer testing position @xbox @ybox
next
forever
----------------------------------------------------------------------------
Mon, 14 Feb 2005
Images with a mask (set by IMAGESETMASK) now uses MaskBlt whenever
possible (basicly not on Win9x). This gives better results when
printing masked images, and is slightly faster in general.
New command IMAGEFINDEDGE searches for a circular edge using the
Image Mask. If an image is passed to it with no mask, then the
color from pixel location 0,0 is used to create a temporary mask (all
pixels of that color are set to true within the mask).
ImageFindEdge returns the center position, x radius and y radius of an oval.
RESULTS = ARRAY(IMAGEFINDEDGE(IMAGEBUF))
IMAGEFINDEDGE IMAGEBUF XPOSVAR YPOSVAR RADIUSVAR
IMAGEFINDEDGE IMAGEBUF XPOSVAR YPOSVAR XRADIUSVAR YRADIUSVAR
Working example:
drawclear red
imagetran on white
imageload logo.gif example
imageput 100 100 example
color green
color white
imagefindedge example xpos ypos xrad yrad
drawcircle @xpos+100 @ypos+100 @xrad @yrad 3
imagefindedge example xpos ypos rad
color yellow
drawcircle @xpos+100 @ypos+100 @rad @rad 3
forever
IMAGEFINDEDGE is included in AGCMD.DAT (used by editor).
----------------------------------------------------------------------------
Wed, 09 Feb 2005
IMAGEFLOODSEARCH more than tripled in speed, the extra searches were
removed (no 2nd pass), and the bit testing for previously checked
areas is now optimized inline.
Sytnax for IMAGEFLOODSEARCH corrected to not include reference to
EDGECOLOR which is not supported for IMAGEFLOODSEARCH.
New code to allow IMAGESETMASK images to be placed onto a printed
page. Previously this could not work because AND/XOR to a printer HDC
is now allowed by windows (you cannot do any graphic operation that
need to "read" or interact with the printer background). The new
code scans the image mask and breaks the IMAGEPUT into multiple
puts, one for each horizontal line segment. Very complex masked
images (like a page of japanese text for instance) will require
a LARGE number of Windows BitBlt calls to be written the printer
which some printers may not handle. But on simple images like
a picture of a cookie (biscuit) that just need to be printed over
a complex background, it works fine.
----------------------------------------------------------------------------
Mon, 07 Feb 2005
Some serious overflow and calculation bugs in ImageScaling code when
drasticly scaling down (less than 16th the size) are fixed.
New command IMAGEFLOODSEARCH, syntax is similar to IMAGEFLOOD except
there is an optional radius and percent match within radius parameters.
AGCMD.DAT is updated so editor knows about new command.
RADIUS is how large an area to search for when trying to identify
other regions to mask. If no radius is given then a radius of 4 pixels
is assumed.
SPERCENT is the search's match percentage, the default is 0
RESULTIMAGE = IMAGEFLOODSEARCH(SOURCEIMAGE)
RESULTIMAGE = IMAGEFLOODSEARCH(SOURCEIMAGE,XPOS,YPOS)
RESULTIMAGE = IMAGEFLOODSEARCH(SOURCEIMAGE,XPOS,YPOS,PERCENT)
RESULTIMAGE = IMAGEFLOODSEARCH(RADIUS,SOURCEIMAGE)
RESULTIMAGE = IMAGEFLOODSEARCH(RADIUS,SOURCEIMAGE,XPOS,YPOS)
RESULTIMAGE = IMAGEFLOODSEARCH(RADIUS,SOURCEIMAGE,XPOS,YPOS,PERCENT)
RESULTIMAGE = IMAGEFLOODSEARCH(RADIUS,SPERCENT,SOURCEIMAGE)
RESULTIMAGE = IMAGEFLOODSEARCH(RADIUS,SPERCENT,SOURCEIMAGE,XPOS,YPOS)
RESULTIMAGE = IMAGEFLOODSEARCH(RADIUS,SPERCENT,SOURCEIMAGE,XPOS,YPOS,PERCENT)
IMAGEFLOODSEARCH SOURCEIMAGE MASKIMAGENAME
IMAGEFLOODSEARCH SOURCEIMAGE MASKIMAGENAME XPOS YPOS
IMAGEFLOODSEARCH SOURCEIMAGE MASKIMAGENAME XPOS YPOS PERCENT
IMAGEFLOODSEARCH RADIUS SOURCEIMAGE MASKIMAGENAME
IMAGEFLOODSEARCH RADIUS SOURCEIMAGE MASKIMAGENAME XPOS YPOS
IMAGEFLOODSEARCH RADIUS SOURCEIMAGE MASKIMAGENAME XPOS YPOS PERCENT
IMAGEFLOODSEARCH RADIUS SPERCENT SOURCEIMAGE MASKIMAGENAME
IMAGEFLOODSEARCH RADIUS SPERCENT SOURCEIMAGE MASKIMAGENAME XPOS YPOS
IMAGEFLOODSEARCH RADIUS SPERCENT SOURCEIMAGE MASKIMAGENAME XPOS YPOS PERCENT
Working example that shows the limits of IMAGEFLOOD, and how IMAGEFLOODSEARCH
gets around these limits:
basesize = 400
windowsize @basesize*2 @basesize
drawclear green
imagenew milk 1000 1000
imageset milk
drawclear white
xpos = 120
ypos = 120
lastxpos = 120
lastypos = 120
beginloop 20
if @xpos>100||@ypos>100
color random(0,255,3)
drawanticirclefilled @xpos @ypos 80
drawantiline @xpos @ypos @lastxpos @lastypos 10
endif
lastxpos = @xpos
lastypos = @ypos
inc xpos (random(60)-30)*15
inc ypos (random(60)-30)*15
if @xpos<0
inc xpos @drawmaxx
endif
if @xpos>@drawmaxx
dec xpos @drawmaxx
endif
if @ypos<0
inc ypos @drawmaxy
endif
if @ypos>@drawmaxy
dec ypos @drawmaxy
endif
endloop
color white
drawrect 0 0 10 10
imageset
imagecopy smilk milk
imageflood milk milkmask 0 0 4 ; 4 percent off color allowed
imageprocess milkmask invert
imagesize @basesize 0 8 milkmask
imagesize @basesize 0 milk
imagealphaset milk milkmask
imageput milk
imagefloodsearch 2 0 smilk smilkmask 0 0 4 ; 4 percent off color allowed
imageprocess smilkmask invert
imagesize @basesize 0 8 smilkmask
imagesize @basesize 0 smilk
imagealphaset smilk smilkmask
imageput @basesize 0 smilk
forever
----------------------------------------------------------------------------
Sun, 30 Jan 2005
Bug found in Microsoft CopyImage() API call which truncates color values.
All calls to CopyImage() are removed and replaced with custom scaling
code. Some scaling operations may be slower.
----------------------------------------------------------------------------
Thu, 27 Jan 2005
Rebuilt using Visual Studio 6 SP6 (was previously using SP5).
STRLEFTHTML STRRIGHTHTML STRLEFTRIGHTHTML and STRMIDHTML all had
a memory leak, the first tag it found was never free'd up when the
function was exited.
Bug in STR*HTML functions which caused duplicate end tags to be
generated when the first tag was used again is fixed.
STRLEFTRIGHTHTML was giving incorrect results when the position was
at the end of the source string. Fixed.
Some odd bugs in TEXTFIT when dealing with word wrapping, and
html tags are fixed.
----------------------------------------------------------------------------
Tue, 18 Jan 2005
TEXTFIT command implemented, syntax is:
CHARPOS = TEXTFIT(STRING)
CHARPOS = TEXTFIT(STRING, WIDTH)
CHARPOS = TEXTFIT(STRING, WIDTH, HEIGHT)
CHARPOS = TEXTFIT(STRING, WIDTH, HEIGHT, FIRSTCHAR)
STRTRIM STRTRIMLEFT and STRTRIMRIGHT commands now trim whitespace, not just
spaces. Whitespace includes ascii 32 (space), 9 (tab), 10 (linefeed),
13 (carriage return), 0 (null), and 26 (end of file).
New unirary '&' operator (which calls the new VARREFERENCE command), used
with a variable name it will provide a variable's low level reference.
On simple variables like strings or numbers, this is virtually identical
to the '@' operator. But with arrays and other complex objects, it
allows passing of arrays by reference. Previously, the only way to pass
an array was to copy it into another array, which was
slow and wasteful, and did not work on multi-dimensional arrays.
Example:
drawclear white
color black
a = array(one,array(aa,bb,cc),three,four)
testfunc @a ;displays just 'one'
testfunc array(@a) ;displays the entire array, but slow and wasteful
; looses 2nd dimension in array
testfunc &a ;displays the entire array
forever
testfunc:
declare value
text @value
text @value[1][2]
text @value[1][1]
text @value[1][0]
textln
return
FILEPUTARRAYNAMED fixed to correctly write the array in the same
order as the named index.
For example, this array read with FILEGETARRAYNAMED:
page,type,x1,y1,x2,y2
1,text,20,0,98,24
1,text,20,25,98,49
1,text,20,50,98,74
1,text,20,75,98,99
Was being written by FILEPUTARRAYNAMED as:
page,type,x1,y1,x2,y2
text,24,98,0,20,1
text,49,98,25,20,1
text,74,98,50,20,1
text,99,98,75,20,1
Now it matches the original file, written in the same order.
----------------------------------------------------------------------------
Thu, 13 Jan 2005
PNG support upgraded to libpng version 1.2.8, but unfortunately there
are still problems with PNG loaded (CRC errors on IEND, still baffled
as to the cause).
GPF crash in FILEGETVARS fixed (bug was introduced in Mon Jan 10 build).
Extra checks added to ItemSimplify (used to simplify strings into
numbers if the formatting matches) to prevent crash in future.
Bug in compiling of loops with a FROM and COUNT, the step would
have an invalid value instead of 1. Fixed.
IMAGEFADEXY was loosing the Y coordinate in many cases, fixed.
Test script for IMAGEFADEXY:
drawclear white
set texthtml on
text ""
f = array(
imagenew(320 240 32 red)
imagenew(320 240 32 green)
imagenew(320 240 32 blue)
imagenew(320 240 32 yellow)
imagenew(320 240 32 cyan)
)
xpos = array(center left right)
ypos = array(center top bottom)
fn = 0
beginloop
for x from 0 count xpos->size
for y from 0 count ypos->size
layer blah text @xpos[@x]$" "$@ypos[@y]
imagefadexy @fn%8+1 @xpos[@x] @ypos[@y] @f[@fn%f->size] 150
inc fn
next
next
endloop
forever
----------------------------------------------------------------------------
Mon, 10 Jan 2005
TEXTLN when TEXTHTML is enabled and then disabled was not working,
it would try to display "
" when HTML text was disabled.
The reverse was also true. If TEXTLN was used before TEXTHTML was
enabled, then the correct line breaks would never be displayed when
HTML text was enabled. Fixed.
Copyright dates moved to 2005.
Fade coordinates, such as in the IMAGEFADEXY command now support
measurements, as well as top/left/right/bottom/center.
Extensive new error checking added to almost all commands preventing
accidental use of parameters not passed, or other mistakes.
Almost all references to STACK (usually parameters passed back and
forth), are now done with code macros that do extra checks to prevent
invalid access.
New commands added:
STRLEFTHTML
STRLEFTRIGHTHTML
STRMIDHTML
STRRIGHTHTML
Exact same syntax as STRLEFT, STRLEFTRIGHT, STRMID and STRRIGHT. Strings
extracted have tags corrected. So any open tags are closed, and any
tags with only closing tag have the leading tag added.
Here is a working test example:
drawclear white
color black
set textwrap off
set texthtml on
teststrhtml
textln
set texthtml off
teststrhtml
forever
teststrhtml:
set teststr = "Hello There Test Subject"
textln @teststr
textln strlefthtml(@teststr, strsearch(@teststr, "There")-1)$" Left"
textln strleftrighthtml(@teststr, strsearch(@teststr, "There")+3)$" Right"
textln strmidhtml(@teststr, strsearch(@teststr, "Test"), 4)$" Mid"
return
----------------------------------------------------------------------------
Thu, 16 Dec 2004
Under calculation bug in VECANGLE which also affected
IMAGEROTATE/IMAGEANTIROTATE (would squish smaller images) is fixed.
IMAGEANTIROTATE IMAGEROATE, IMAGEANTIWARP and IMAGEWARP now calculate the
coordinates in floating point, and will accept floating point coordinate
values.
IMAGEANTIROTATE and IMAGEANTIWARP now use a sliding scale for the amount
of anti-aliasing to use. It uses a 4x anti-alias (the previous default)
for most images, but will increase it to 8x for images with under 800
total pixels, and 16x for images with under 400 total pixels.
The CD-ROM Detection variables are now supported:
@DRIVECDROM
@DRIVECDROMS
The SOUNDBEEP command now beeps (single simple beep).
Small memory leak when closing files is fixed.
Bug in auto searching for .GZ file extension when opening files is fixed.
Four new system variables:
@MOUSEDOWNX1
@MOUSEDOWNX2
@MOUSEUPX1
@MOUSEUPX2
These provide the mouse click information on the extended Intellimouse
buttons (the eXtended Button1 and eXtended Button 2). The Intellipoint
end user application software, if installed, may prevent these
buttons from working (it let's them be assigned to other tasks).
Six new WHEN types:
WHEN MOUSEDOWNX1
WHEN MOUSEDOWNX2
WHEN MOUSEUPX1
WHEN MOUSEUPX2
WHEN MOUSEWHEELDOWN
WHEN MOUSEWHEELUP
Example:
windowsize 1024 768
drawclear white
color black
imageload p6.emf
imagesize 1024 0 p6 -2 -2
imageput p6
chunkx = 300
chunky = 175
antimul = 2
zoom = 3
when micezoomup mousewheelup
zoom = @zoom*1.1
UpdateZoom
soundbeep
endwhen
when micezoomdown mousewheeldown
zoom = @zoom/1.1
UpdateZoom
soundbeep
endwhen
when micemove mousemove gosub UpdateZoom
UpdateZoom
forever
UpdateZoom:
mouseget b xpos ypos
dec xpos @chunkx/2
dec ypos @chunky/2
imagepiece piece @zoom @antimul center center p6 @xpos @ypos @chunkx @chunky
imageprocess piece tint 10 blue
imageset piece
color white
drawbox 0 0 @drawmaxx @drawmaxy 2
imageset
layer hello @xpos @ypos image piece filter 68
return
The WHEN MOUSEWHEELUP and WHEN MOUSEWHEENDOWN still have a bug that makes
them respond poorly when a WHEN MOUSEMOUSE is also active (I'm
still working on debugging this odd problem).
----------------------------------------------------------------------------
Sun, 12 Dec 2004
A couple problems with previous builds Modular support fixed (mostly
some extra OBJ files left in place).
Database support code needed to change a open file from read-only or
write-only to read/write put in place.
----------------------------------------------------------------------------
Thu, 09 Dec 2004
New command IMAGEPIECE:
IMAGEPIECE NEWIMAGE SRCIMAGE
IMAGEPIECE NEWIMAGE SRCIMAGE STARTX STARTY
IMAGEPIECE NEWIMAGE SRCIMAGE STARTX STARTY XSIZE YSIZE
IMAGEPIECE NEWIMAGE SRCIMAGE STARTX STARTY XSIZE YSIZE VIRTXSIZE VIRTYSIZE
IMAGEPIECE NEWIMAGE ZOOM SRCIMAGE
IMAGEPIECE NEWIMAGE ZOOM SRCIMAGE STARTX STARTY
IMAGEPIECE NEWIMAGE ZOOM SRCIMAGE STARTX STARTY XSIZE YSIZE
IMAGEPIECE NEWIMAGE ZOOM SRCIMAGE STARTX STARTY XSIZE YSIZE VIRTXSIZE VIRTYSIZE
IMAGEPIECE NEWIMAGE ZOOM ANTIMUL SRCIMAGE
IMAGEPIECE NEWIMAGE ZOOM ANTIMUL SRCIMAGE STARTX STARTY
IMAGEPIECE NEWIMAGE ZOOM ANTIMUL SRCIMAGE STARTX STARTY XSIZE YSIZE
IMAGEPIECE NEWIMAGE ZOOM ANTIMUL SRCIMAGE STARTX STARTY XSIZE YSIZE VIRTXSIZE VIRTYSIZE
IMAGEPIECE NEWIMAGE ZOOM ANTIMUL XOFFSET YOFFSET SRCIMAGE
IMAGEPIECE NEWIMAGE ZOOM ANTIMUL XOFFSET YOFFSET SRCIMAGE STARTX STARTY
IMAGEPIECE NEWIMAGE ZOOM ANTIMUL XOFFSET YOFFSET SRCIMAGE STARTX STARTY XSIZE YSIZE
IMAGEPIECE NEWIMAGE ZOOM ANTIMUL XOFFSET YOFFSET SRCIMAGE STARTX STARTY XSIZE YSIZE VIRTXSIZE VIRTYSIZE
NEWIMAGE is the image to create (which is a piece of SRCIMAGE)
SRCIMAGE is the source image
ZOOM is the zoom level (how much the source image is enlarged
before taking out a hunk) (defaults to 1)
ANTIMUL is the anti-alias multiply, only for vector images (defaults to 1)
XOFFSET,YOFFSET are the offset to adjust the startx and starty from,
supports LEFT/CENTER/RIGHT TOP/CENTER/BOTTOM as well as numeric coordinates.
(defaults to 0,0)
STARTX, STARTY is the upper left hand corner of the area to extract as
a piece.
XSIZE YSIZE is the width and height of the area to extract.
VIRTXSIZE, VIRTYSIZE is the virtual size of the SRCIMAGE, the image is
blown up to this size before extracting the piece. Useful particularly
for vector images. Options for VIRTXSIZE and VIRTYSIZE are the same
as for the IMAGESIZE command (if negative the original size is multiplied
by the absolute value, if 0 then adjusted to the same ratio as the other
axis is scaled).
Working example:
windowsize 1024 768
drawclear white
imageload p6.emf
imagesize 1024 0 p6 -2 -2
imageput p6
chunkx = 300
chunky = 175
antimul = 2
zoom = 3
beginloop
mouseget b xpos ypos
dec xpos @chunkx/2
dec ypos @chunky/2
imagepiece piece @zoom @antimul center center p6 @xpos @ypos @chunkx @chunky
imageprocess piece tint 10 blue
imageset piece
color white
drawbox 0 0 @drawmaxx @drawmaxy 2
imageset
layer hello @xpos @ypos image piece filter 68
endloop
----------------------------------------------------------------------------
Mon, 06 Dec 2004
Anything beyond the 2nd parameter passed to the AG runtime was
being lost (the code which looks for a script filename was trimming
the original command line string inside windows!). Fixed.
New modular compile OPTION DATABASE
Most database commands now active (requires testing), same syntax
as GLPRO. I've tried to replicate most of the functionality, but there
is no DOS ASCII support.
Writing to database still needs some debugging (changing from reading
to read/write isn't working).
----------------------------------------------------------------------------
Tue, 30 Nov 2004
The FILEPUTVARIABLES command now supports arrays. For example:
drawclear white
a[2] = goodbye
a[99] = frank
a[1] = hello
a[blue] = green
fileputvariables(test.txt,a)
global filegetvariables(test.txt)
set variables on
exitnow
Produces a file with this contents:
a[1] = hello
a[2] = goodbye
a[99] = frank
a[blue] = green
The FILEGETVARIABLES command now supports arrays, including
multi-dimensional arrays.
Added two hotkeys always active:
SHIFT-CTRL-V toggles the Variables window
SHIFT-CTRL-D toggles the Debug window
I used SHIFT-CTRL because ALT is so closely tied to being the "System"
key. I didn't want it to be shift or ctrl alone because it might be hit
accidently.
The VARIABLES display can now be opened and closed repeatedly. Previously
there was a bug which prevented it from ever being opened again once it
had been closed.
----------------------------------------------------------------------------
Mon, 29 Nov 2004
IMAGEEMFSCRIPT now writes images used in SETDIBITSTODEVICE and
STRETCHDIBITS EMF records to disk as BMP files (in original format
directly from the EMF record). The commands to load/display these
images are not correctly generated yet (next build).
The images are written as EMF_Image0.bmp EMF_Image1.bmp and so on.
Support added for limted version of the tag in HTML text.
Only the tag is recognized,
other tags are seen, but ignored.
Useful for maintaining exact indent levels in HTML text, for
example the word "Folks" here lines up exactly on both lines
of text.
drawclear white
set texthtml on
text ""
textln "Hello There Folks"
textln "Hello There Folks"
forever
When the visibility hidden tag is used, the text is not drawn at all
but the text position is advanced as if it was.
----------------------------------------------------------------------------
Wed, 24 Nov 2004
Color was incorrect (Red and Green reversed) in these commands:
WinCreateBrushIndirect
WinCreatePenIndirect
WinExtCreatePen
WinExtFloodFill
WinSetBkColor
WinSetPixelV
WinSetTextColor
IMAGEEMFSCRIPT no longer generates TRANSFORM commands, it precalculates
final coordinates and sizes in floating point. This includes:
WinSetWorldTransform
WinModifyWorldTransform
WinSetWindowExtEx
WinSetWindowOrgEx
WinSetViewportExtEx
WinSetViewportOrgEx
Some coordinates are reversed sometimes, but the results are
fairly impressive (it actually works!).
IMAGEEMFSCRIPT now uses the size set with IMAGESIZE (or if no IMAGESIZE
was used, the default image's size) for the coordinates generated.
IMAGEEMFSCRIPT now uses a temporary HDC for all transforms, this prevents
wierd errors, and resource leaks that were happening.
IMAGEEMFSCRIPT now calculates the font heights, and pen sizes based on
the final EMF size (they used to be fixed).
IMAGEEMFSCRIPT now outputs all integer coordinates as integer, their
final value is calculated in floating point, but the result written
to the script is rounded to the nearest integer value.
Unforunately, although improved, the IMAGEEMFPERCENT option does not
produce correctly displaying scripts. (some problems in how AG
supports the PCT operator is the likely culprit).
----------------------------------------------------------------------------
Mon, 22 Nov 2004
IMAGEEMFTEXT fixed so that the output from FILEPUTARRAYNAMED correctly
lines up with the columns.
IMAGEEMFTEXT will now combine text that is adjacent in the same
color, font, height and style. It will not combine text across
lines (wrapped text). If adjacent text does not include spaces,
spaces will be added.
Be careful using the FileClose command on anything but a filestream, if
you use it on objects (pictures, strings, fonts), it will try to remove
them from memory, and cause odd things if you were using them.
----------------------------------------------------------------------------
Sun, 21 Nov 2004
IMAGECOPY if passed a single parameter returns a copy of an image.
One example of this usage:
imageset imagecopy(pointer)
color red
drawline 0 0 @drawmaxx @drawmaxy
result = imageset()
IMAGEANTIROTATE was not correctly moving the image position to maintain
the same position as with IMAGEROTATE.
IMAGENEW now sets the current drawcolor inside an image to whatever
color the image was cleared to. So for instance:
drawclear black
color red
imagenew test 100 100
imageset test
imagenew blah 100 100
imageset
imageput blah ; displays a red box, used to be white
forever
Previously, it always defaulted to WHITE. Another example that
creates an rotated alphamask:
x = 0
for R from -45 step 45 count 3
color black
imageset imagenew(pointer->sizex pointer->sizey)
imageantirotate pointer @R
imagealphaset pointerW1 imageset()
layer l1 70 34 image pointerW1
imagefadexy 36 @x 0 go$@loop 100 200
inc x 97
next
Numerous fixes to XFORM usage, unfortunately some EMF's still do not
play correctly after translation via IMAGEEMFSCRIPT.
WinPolyPolygon was not being correctly generated by IMAGEEMFSCRIPT
(it was calling WinPolyPolyLine).
WinExtTextOut now has the X/Y/TYPE parameters as optional, if all three
are left out, they are assumed to be zero.
----------------------------------------------------------------------------
Mon, 08 Nov 2004
New AGEDIT from Dick which fixes the buffer overflow problem created by
the sudden and dramatic increase in the number of commands.
The WinModifyWorldTransform syntax has changed, it's now:
WINMODIFYWORLDTRANSFORM MODE XFORMARRAY
The IMAGEEMFSCRIPT command no longer generates a blank entry for
XFORMARRAY "array()" in the WinModifyWorldTransform. So for instance
to reset the transform to default (no transform), it would generate:
WINMODIFYWORLDTRANSFORM 1
"WINSETWORLDTRANSFORM array()" no longer needs the empty array, works
fine as just "WINSETWORLDTRANSFORM" with no parameters.
IMAGEEMFSCRIPT now eliminates duplicate WinSetTextColor,
WinSetBkColor, WinSetTextAlign, WinSetBkMode, WinSelectObject statements.
IMAGEEMFSCRIPT now combines font definitions so each font is only
defined once, and free'd at the end of the script.
Bug in generation of XFORM arrays which left out values in the middle
(which confused the code which needed to parse the array) is fixed.
----------------------------------------------------------------------------
Sun, 07 Nov 2004
First EMF Script that plays entirely!
Fixed bugs in IMAGEFADE BLEND, the number of steps did not correctly
include the final step. The number of steps in a blend fade is
always a power of 2 since the blend calculation is done with shifts,
but the number of steps did not include both the first null step
used to calculate fade speed, and the final step.
Bug first reported by Dick Trump on Aug 11, 2004, with a follow-up
including example on Oct 18, 2004.
Documentation note, the PRINTSETTINGS PAPERSIZE option has it's width
and height swapped when the PRINTSETTINGS LANDSCAPE option used (this
is how window's processes it, I'm not swapping the values).
The @SCRIPTNAME variable is now supported.
New setable system variable @IMAGEEMFTEXTWIDTHS controls whether the
IMAGEEMFSCRIPT command generates the list of character widths for
each ExtTextOut command. These values are often wrong for different
resolutions, and counter productive. The default is OFF. You may
need to turn this ON to get accurate spacing for unusual fonts
or pre-kerned text.
The IMAGEEMFPERCENT variable now defaults to OFF. More work to replace
the WorldTransform with pre-transformed coordinates will be required
before pct type coordinates will work with scripts generated by
IMAGEEMFSCRIPT. This work will also be required to make EMF scripts
run on Win9x since the WorldTransform functions are not available
in Win9x.
----------------------------------------------------------------------------
Thu, 04 Nov 2004
PRINTPAPERSIZE command removed.
New PRINTSETTINGS option, PAPERSIZE, size is in units of 1/10th of a
millimeter.
Example which creates a PDF (expects default printer driver to be
a Postscript driver setup to write to a file).
drawclear white
set mydpi 300
; how many pixels per 1/10th of a MM
mmperpixel = @mydpi/254.
paperwidth = 1200
paperheight = 1200
printsettings dpi @mydpi papersize @paperwidth/@mmperpixel @paperheight/@mmperpixel
PDFfilename = "c:\\digi-pdf.pdf"
PSfilename = "c:\\digi-pdf.ps"
set printfilename @PSfilename
printstart
printstartpage
printset
color blue
drawboxround 0 0 @drawmaxx @drawmaxy 9pct
color black
drawboxround 10pct 10pct @drawmaxx-10pct @drawmaxy-10pct 9pct
color red
drawboxround 20pct 20pct @drawmaxx-20pct @drawmaxy-20pct 9pct
color green
drawboxround 30pct 30pct @drawmaxx-30pct @drawmaxy-30pct 9pct
imageset
printendpage
printend
appexec "c:\\gs\\gs8.14\\bin\\gswin32c.exe" "-sDEVICE=pdfwrite -q -dPDFSETTINGS=/ebook -dCompatibilityLevel=1.3 -dNOPAUSE -dBATCH -sOutputFile="$@quote$@PDFfilename$@quote$" -c save pop -f "$@quote$@PSfilename$@quote
exitnow
----------------------------------------------------------------------------
Wed, 03 Nov 2004
New command PRINTPAPERSIZE, used much like the PRINTSETTINGS command.
Takes two parameters, the page width, and page height, both in units
of 1/10th of a millimeter.
Test EMF script generated with IMAGEEMFSCRIPT actually runs! Text is ok,
drawn art is mysteriously missing, but it's a start. IMAGEEMFPERCENT ON
does not produce a script that will work (requires changes to all the
XFORM data in transformation commands).
WinGetStockObject now accepts NULL_BRUSH (instead of HOLLOW_BRUSH), and
NULL_PEN.
Fraction lookup for IMAGEEMFSCRIPT now handles negative numbers, and
numbers larger than 1. For instance 1.33333 will get written as 4/3.
Support for suffix operators (like pct or mm) is no longer valid with
a space inbetween. So 100pct is fine, but 100 pct is not. This is to
help clean up some wierd cases in the expression parser, like:
text(100 100 pct)
Bug in parsing of negative numbers passed to a function fixed.
For instance:
drawclear white
color black
hello(5 -1)
forever
hello:
textln @1
return
This should have displayed 5, but was displaying 4 (5-1). If you wish
to subtract, you can write hello(5-1) or hello(5 - 1), both of which
will pass 4 to the hello function. This also applies to more complex
cases like:
hello(5 -@rate)
hello(@rate*@base -1)
hello(@rate -(5+@rate))
All these cases are now fixed.
----------------------------------------------------------------------------
Mon, 01 Nov 2004
Hanging bug in TextWidth (and in LAYER TEXT) when any NULL characters
are at the end of a string is fixed.
The QUALITY option in IMAGESAVEJPEG if larger than 1024 is instead
treated as a maximum filesize. The JPEG is written over and over until
a file is created as close as possible to the desired size (but not
over that size). The maximum number of writes is 8, so this may take
8x longer than IMAGESAVEJPEG normally would.
Numerous crashing bugs on more complex EMFs fixed.
Several performance system wide performance improvements made
(allocated buffers no longer zero'd out twice, or at all if they
are going to be immediately overwritten).
More error checking added to array management.
New system variable SET IMAGEEMFPERCENT ON/OFF. Defaults to ON.
Controls the writing of coorindates in the IMAGEEMFSCRIPT command.
When ON, all coordinates are written as a percentage (accurate to 4
decimal places).
Started percentage coordinate generation in IMAGEEMFSCRIPT, all lists
of points, and rects are done as percentage (when IMAGEEMFPERCENT ON).
Some assorted fixes in IMAGEEMFSCRIPT (missing spaces)
Fractions are auto generated for common numbers between 0 and 1 if the
fraction is shorter than the number with all decimal places.
WinRestoreDC with no parameters defaults to -1 (the most common use).
"XFORMARRAY" can now be 0, 2, 4 or 6 six floating point numbers that define an
XFORM transformation structure for GDI:
Array() same as Array(1 1)
Array(M11 M22)
Array(M11 M22 Dx Dy)
Array(M11 M12 M21 M22 Dx Dy)
----------------------------------------------------------------------------
Mon, 18 Oct 2004
Added a zillion new commands, most are direct mappings of Windows API calls
required to playback scripts generated by IMAGEEMFSCRIPT. The HDC
(device context handle) passed in all these GDI API calls is the current
draw buffer's HDC (normally the window frame unless IMAGESET or PRINTSET are
in effect).
Remaining tasks on the EMF Script project include:
1. BitBlt Script Generation and Commands
2. Script Generation using Percentage for Coordinates
3. Script optimization (removing redundant commands)
Data types used for some more complex parameters:
"PALETTEARRAY" is an array of DWORD values for a palette:
Array(DWORDPalEntry DWORDPalEntry ...)
http://www.google.com/search?&q=msdn+library+gdi+PALETTEENTRY&btnI=I'm+Feeling+Lucky
"RECTARRAY" is an array of four integers that define a rectangular area:
Array(left top right bottom)
http://www.google.com/search?&q=msdn+library+gdi+RECT&btnI=I'm+Feeling+Lucky
"XFORMARRAY" is an array of six floating point numbers that define a XFORM transformation structure for GDI:
Array(M11 M12 M21 M22 Dx Dy)
http://www.google.com/search?&q=msdn+library+gdi+XFORM&btnI=I'm+Feeling+Lucky
"BITMAPARRAY" is an array with these items, only the palette is optional:
Array(Width Height Planes BitCount Compression SizeImage XPelsPerMeter YPelsPerMeter ClrUsed ClrImportant Usage [PALETTEARRAY] ImageDataString)
http://www.google.com/search?&q=msdn+library+gdi+BITMAPINFO&btnI=I'm+Feeling+Lucky
"REGIONARRAY" is a group of arrays that define a region:
Array(Type RECTARRAY RECTARRAY ...)
http://www.google.com/search?&q=msdn+library+gdi+RGNDATA&btnI=I'm+Feeling+Lucky
"POINTSARRAY" is a list of coordinate pairs:
Array(X,Y X,Y X,Y X,Y X,Y ...)
http://www.google.com/search?&q=msdn+library+gdi+tagPOINT&btnI=I'm+Feeling+Lucky
List of commands with parameters, those with '*' are complete, others are
under development. Those with () take no parameters. The URL listed under
each command brings up the Microsoft MSDN help for that API call.
Items in brackets are optional, for instance the bounding rectangle
used for WinExtTextOut.
* WinAbortPath ()
http://www.google.com/search?&q=msdn+library+gdi+AbortPath&btnI=I'm+Feeling+Lucky
* WinAngleArc X Y Radius StartAngle SweetAngle
http://www.google.com/search?&q=msdn+library+gdi+AngleArc&btnI=I'm+Feeling+Lucky
* WinArc LeftRect TopRect RightRect BottomRect XStartArc YStartArc XEndArc YEndArc
http://www.google.com/search?&q=msdn+library+gdi+Arc&btnI=I'm+Feeling+Lucky
* WinArcTo LeftRect TopRect RightRect BottomRect XRadial1 YRadial1 XRadial2 YRadial2
http://www.google.com/search?&q=msdn+library+gdi+ArcTo&btnI=I'm+Feeling+Lucky
* WinBeginPath ()
http://www.google.com/search?&q=msdn+library+gdi+BeginPath&btnI=I'm+Feeling+Lucky
WinBitBlt
http://www.google.com/search?&q=msdn+library+gdi+BitBlt&btnI=I'm+Feeling+Lucky
* WinChord LeftRect TopRect RightRect BottomRect XRadial1 YRadial1 XRadial2 YRadial2
http://www.google.com/search?&q=msdn+library+gdi+Chord&btnI=I'm+Feeling+Lucky
* WinCloseFigure ()
http://www.google.com/search?&q=msdn+library+gdi+CloseFigure&btnI=I'm+Feeling+Lucky
* HBRUSH = WinCreateBrushIndirect Style Color Hatch
http://www.google.com/search?&q=msdn+library+gdi+CreateBrushIndirect&btnI=I'm+Feeling+Lucky
* HBRUSH = WinCreateDIBPatternBrushPt PackedDIB Usage
http://www.google.com/search?&q=msdn+library+gdi+CreateDIBPatternBrushPt&btnI=I'm+Feeling+Lucky
* HFONT = WinCreateFontIndirect Height Width Escapement Orientation Weight Italic Underline StrikeOut CharSet OutPrecision ClipPrecision Quality PitchAndFamily FaceName
http://www.google.com/search?&q=msdn+library+gdi+CreateFontIndirect&btnI=I'm+Feeling+Lucky
* HPALETTE = WinCreatePalette(Version PALETTEARRAY)
http://www.google.com/search?&q=msdn+library+gdi+CreatePalette&btnI=I'm+Feeling+Lucky
* HBRUSH = WinCreatePatternBrush(BITMAPARRAY)
http://www.google.com/search?&q=msdn+library+gdi+CreatePatternBrush&btnI=I'm+Feeling+Lucky
* HPEN = WinCreatePenIndirect Style WidthX WidthY Color
http://www.google.com/search?&q=msdn+library+gdi+CreatePenIndirect&btnI=I'm+Feeling+Lucky
* WinDeleteObject hObject
http://www.google.com/search?&q=msdn+library+gdi+DeleteObject&btnI=I'm+Feeling+Lucky
* WinEllipse LeftRect TopRect RightRect BottomRect
http://www.google.com/search?&q=msdn+library+gdi+Ellipse&btnI=I'm+Feeling+Lucky
* WinEndPath ()
http://www.google.com/search?&q=msdn+library+gdi+EndPath&btnI=I'm+Feeling+Lucky
* WinExcludeClipRect LeftRect TopRect RightRect BottomRect
http://www.google.com/search?&q=msdn+library+gdi+ExcludeClipRect&btnI=I'm+Feeling+Lucky
* HPEN = WinExtCreatePen PenStyle Width Style Color Hatch [Array(Style Style ...)]
http://www.google.com/search?&q=msdn+library+gdi+ExtCreatePen&btnI=I'm+Feeling+Lucky
* WinExtFloodFill XStart YStart Color FillType
http://www.google.com/search?&q=msdn+library+gdi+ExtFloodFill&btnI=I'm+Feeling+Lucky
* WinExtSelectClipRgn REGIONARRAY Mode
http://www.google.com/search?&q=msdn+library+gdi+ExtSelectClipRgn&btnI=I'm+Feeling+Lucky
* WinExtTextOut X Y Options [RECTARRAY] String [Array(Dx Dx ...)]
http://www.google.com/search?&q=msdn+library+gdi+ExtTextOut&btnI=I'm+Feeling+Lucky
* WinFillPath ()
http://www.google.com/search?&q=msdn+library+gdi+FillPath&btnI=I'm+Feeling+Lucky
* WinFillRgn REGIONARRAY Brush
http://www.google.com/search?&q=msdn+library+gdi+FillRgn&btnI=I'm+Feeling+Lucky
* WinFlattenPath ()
http://www.google.com/search?&q=msdn+library+gdi+FlattenPath&btnI=I'm+Feeling+Lucky
* WinFrameRgn REGIONARRAY Brush Width Height
http://www.google.com/search?&q=msdn+library+gdi+FrameRgn&btnI=I'm+Feeling+Lucky
* WinGetStockObject ObjectID
http://www.google.com/search?&q=msdn+library+gdi+GetStockObject&btnI=I'm+Feeling+Lucky
Possible ObjectIDs for WinGetStockObject
ANSI_FIXED_FONT
ANSI_VAR_FONT
BLACK_BRUSH
BLACK_PEN
DEFAULT_GUI_FONT
DEFAULT_PALETTE
DEVICE_DEFAULT_FONT
DKGRAY_BRUSH
GRAY_BRUSH
HOLLOW_BRUSH
LTGRAY_BRUSH
OEM_FIXED_FONT
SYSTEM_FIXED_FONT
SYSTEM_FONT
WHITE_BRUSH
WHITE_PEN
* WinIntersectClipRect LeftRect TopRect RightRect BottomRect
http://www.google.com/search?&q=msdn+library+gdi+IntersectClipRect&btnI=I'm+Feeling+Lucky
* WinInvertRgn REGIONARRAY
http://www.google.com/search?&q=msdn+library+gdi+InvertRgn&btnI=I'm+Feeling+Lucky
* WinLineTo XEnd YEnd
http://www.google.com/search?&q=msdn+library+gdi+LineTo&btnI=I'm+Feeling+Lucky
WinMaskBlt
http://www.google.com/search?&q=msdn+library+gdi+MaskBlt&btnI=I'm+Feeling+Lucky
* WinModifyWorldTransform XFORMARRAY Mode
http://www.google.com/search?&q=msdn+library+gdi+ModifyWorldTransform&btnI=I'm+Feeling+Lucky
* WinMoveToEx X Y
http://www.google.com/search?&q=msdn+library+gdi+MoveToEx&btnI=I'm+Feeling+Lucky
* WinOffsetClipRgn XOffset YOffset
http://www.google.com/search?&q=msdn+library+gdi+OffsetClipRgn&btnI=I'm+Feeling+Lucky
* WinPaintRgn REGIONARRAY
http://www.google.com/search?&q=msdn+library+gdi+PaintRgn&btnI=I'm+Feeling+Lucky
* WinPie LeftRect TopRect RightRect BottomRect XRadial1 YRadial1 XRadial2 YRadial2
http://www.google.com/search?&q=msdn+library+gdi+Pie&btnI=I'm+Feeling+Lucky
* WinPolyBezier POINTSARRAY
http://www.google.com/search?&q=msdn+library+gdi+PolyBezier&btnI=I'm+Feeling+Lucky
* WinPolyBezierTo POINTSARRAY
http://www.google.com/search?&q=msdn+library+gdi+PolyBezierTo&btnI=I'm+Feeling+Lucky
* WinPolyDraw POINTSARRAY Array(Type Type Type ...)
http://www.google.com/search?&q=msdn+library+gdi+PolyDraw&btnI=I'm+Feeling+Lucky
* WinPolygon POINTSARRAY
http://www.google.com/search?&q=msdn+library+gdi+Polygon&btnI=I'm+Feeling+Lucky
* WinPolyline POINTSARRAY
http://www.google.com/search?&q=msdn+library+gdi+Polyline&btnI=I'm+Feeling+Lucky
* WinPolylineTo POINTSARRAY
http://www.google.com/search?&q=msdn+library+gdi+PolylineTo&btnI=I'm+Feeling+Lucky
* WinPolyPolygon POINTSARRAY Array(Count Count Count ...)
http://www.google.com/search?&q=msdn+library+gdi+PolyPolygon&btnI=I'm+Feeling+Lucky
* WinPolyPolyline POINTSARRAY Array(Count Count Count ...)
http://www.google.com/search?&q=msdn+library+gdi+PolyPolyline&btnI=I'm+Feeling+Lucky
WinPolyTextOut
http://www.google.com/search?&q=msdn+library+gdi+PolyTextOut&btnI=I'm+Feeling+Lucky
* WinRealizePalette ()
http://www.google.com/search?&q=msdn+library+gdi+RealizePalette&btnI=I'm+Feeling+Lucky
* WinRectangle LeftRect TopRect RightRect BottomRect
http://www.google.com/search?&q=msdn+library+gdi+Rectangle&btnI=I'm+Feeling+Lucky
* WinResizePalette hpal Entries
http://www.google.com/search?&q=msdn+library+gdi+ResizePalette&btnI=I'm+Feeling+Lucky
* WinRestoreDC SavedDC
http://www.google.com/search?&q=msdn+library+gdi+RestoreDC&btnI=I'm+Feeling+Lucky
* WinRoundRect LeftRect TopRect RightRect BottomRect Width Height
http://www.google.com/search?&q=msdn+library+gdi+RoundRect&btnI=I'm+Feeling+Lucky
* WinSaveDC ()
http://www.google.com/search?&q=msdn+library+gdi+SaveDC&btnI=I'm+Feeling+Lucky
* WinScaleViewportExtEx Xnum Xdenom Ynum Ydenom
http://www.google.com/search?&q=msdn+library+gdi+ScaleViewportExtEx&btnI=I'm+Feeling+Lucky
* WinScaleWindowExtEx Xnum Xdenom Ynum Ydenom
http://www.google.com/search?&q=msdn+library+gdi+ScaleWindowExtEx&btnI=I'm+Feeling+Lucky
* WinSelectClipPath Mode
http://www.google.com/search?&q=msdn+library+gdi+SelectClipPath&btnI=I'm+Feeling+Lucky
* HGDIOBJ = WinSelectObject(Object)
http://www.google.com/search?&q=msdn+library+gdi+SelectObjec&btnI=I'm+Feeling+Lucky
* HPALETTE = WinSelectPalette(hpal ForceBackground)
http://www.google.com/search?&q=msdn+library+gdi+SelectPalett&btnI=I'm+Feeling+Lucky
* WinSetArcDirection ArcDirection
http://www.google.com/search?&q=msdn+library+gdi+SetArcDirection&btnI=I'm+Feeling+Lucky
* WinSetBkColor Color
http://www.google.com/search?&q=msdn+library+gdi+SetBkColor&btnI=I'm+Feeling+Lucky
* WinSetBkMode iBkMode
http://www.google.com/search?&q=msdn+library+gdi+SetBkMode&btnI=I'm+Feeling+Lucky
* WinSetBrushOrgEx XOrg YOrg
http://www.google.com/search?&q=msdn+library+gdi+SetBrushOrgEx&btnI=I'm+Feeling+Lucky
* WinSetColorAdjustment Flags IlluminantIndex RedGamma GreenGamma BlueGamma ReferenceBlack ReferenceWhite Contrast Brightness Colorfulness RedGreenTint
http://www.google.com/search?&q=msdn+library+gdi+SetColorAdjustment&btnI=I'm+Feeling+Lucky
WinSetDIBitsToDevice
http://www.google.com/search?&q=msdn+library+gdi+SetDIBitsToDevice&btnI=I'm+Feeling+Lucky
* WinSetMapMode MapMode
http://www.google.com/search?&q=msdn+library+gdi+SetMapMode&btnI=I'm+Feeling+Lucky
* WinSetMapperFlags Flag
http://www.google.com/search?&q=msdn+library+gdi+SetMapperFlags&btnI=I'm+Feeling+Lucky
* WinSetMetaRgn ()
http://www.google.com/search?&q=msdn+library+gdi+SetMetaRgn&btnI=I'm+Feeling+Lucky
* WinSetMiterLimit NewLimit
http://www.google.com/search?&q=msdn+library+gdi+SetMiterLimit&btnI=I'm+Feeling+Lucky
* WinSetPaletteEntries hpal iStart PALETTEARRAY
http://www.google.com/search?&q=msdn+library+gdi+SetPaletteEntries&btnI=I'm+Feeling+Lucky
* WinSetPixelFormat Version Flags PixelType ColorBits RedBits RedShift GreenBits GreenShift BlueBits BlueShift AlphaBits AlphaShift AccumBits AccumRedBits AccumGreenBits AccumBlueBits AccumAlphaBits DepthBits StencilBits AuxBuffers LayerType Reserved LayerMask VisibleMask DamageMask
http://www.google.com/search?&q=msdn+library+gdi+SetPixelFormat&btnI=I'm+Feeling+Lucky
* WinSetPixelV X Y Color
http://www.google.com/search?&q=msdn+library+gdi+SetPixelV&btnI=I'm+Feeling+Lucky
* WinSetPolyFillMode PolyFillMode
http://www.google.com/search?&q=msdn+library+gdi+SetPolyFillMode&btnI=I'm+Feeling+Lucky
* WinSetROP2 DrawMode
http://www.google.com/search?&q=msdn+library+gdi+SetROP2&btnI=I'm+Feeling+Lucky
* WinSetStretchBltMode StretchMode
http://www.google.com/search?&q=msdn+library+gdi+SetStretchBltMode&btnI=I'm+Feeling+Lucky
* WinSetTextAlign Mode
http://www.google.com/search?&q=msdn+library+gdi+SetTextAlign&btnI=I'm+Feeling+Lucky
* WinSetTextColor Color
http://www.google.com/search?&q=msdn+library+gdi+SetTextColor&btnI=I'm+Feeling+Lucky
* WinSetViewportExtEx XExtent YExtent
http://www.google.com/search?&q=msdn+library+gdi+SetViewportExtEx&btnI=I'm+Feeling+Lucky
* WinSetViewportOrgEx X Y
http://www.google.com/search?&q=msdn+library+gdi+SetViewportOrgEx&btnI=I'm+Feeling+Lucky
* WinSetWindowExtEx XExtent YExtent
http://www.google.com/search?&q=msdn+library+gdi+SetWindowExtEx&btnI=I'm+Feeling+Lucky
* WinSetWindowOrgEx X Y
http://www.google.com/search?&q=msdn+library+gdi+SetWindowOrgEx&btnI=I'm+Feeling+Lucky
* WinSetWorldTransform XFORMARRAY
http://www.google.com/search?&q=msdn+library+gdi+SetWorldTransform&btnI=I'm+Feeling+Lucky
WinStretchBlt
http://www.google.com/search?&q=msdn+library+gdi+StretchBlt&btnI=I'm+Feeling+Lucky
WinStretchDIBits
http://www.google.com/search?&q=msdn+library+gdi+StretchDIBits&btnI=I'm+Feeling+Lucky
* WinStrokeAndFillPath ()
http://www.google.com/search?&q=msdn+library+gdi+StrokeAndFillPath&btnI=I'm+Feeling+Lucky
* WinStrokePath ()
http://www.google.com/search?&q=msdn+library+gdi+StrokePath&btnI=I'm+Feeling+Lucky
* WinWidenPath ()
http://www.google.com/search?&q=msdn+library+gdi+WidenPath&btnI=I'm+Feeling+Lucky
----------------------------------------------------------------------------
Tue, 04 Oct 2004
Measurements now support multiply, for instance:
imagesize 50pct*(600/72.) 50pct*(600/72.) faded.jpg
New commands:
LISTSORT
LISTUNIQUE
LISTDUPLICATED
LISTNOTDUPLICATED
All of these commands sort the input list.
LISTSORT only sorts
LISTSORT(2,9,3,7,8,2,3,5,1,3,9,3,4,7)
returns 1,2,2,3,3,3,3,4,5,7,7,8,9,9
LISTUNIQUE sorts, then returns only the unique values (no extra duplicates)
LISTUNIQUE(2,9,3,7,8,2,3,5,1,3,9,3,4,7)
returns 1,2,3,4,5,7,8,9
LISTDUPLICATED sorts, then returns only values that are duplicated.
LISTDUPLICATED(2,9,3,7,8,2,3,5,1,3,9,3,4,7)
returns 2,3,7,9
LISTNOTDUPLICATED sorts, then removed all duplicates (the reverse of
LISTDUPLICATED).
LISTNOTDUPLICATED(2,9,3,7,8,2,3,5,1,3,9,3,4,7)
returns 1,4,5,8
Runable example:
drawclear white
color black
textln "LISTSORT"
text strlist(LISTSORT(2,9,3,7,8,2,3,5,1,3,9,3,4,7))
text strlist(1,2,2,3,3,3,3,4,5,7,7,8,9,9)
textln
textln "LISTUNIQUE"
text strlist(LISTUNIQUE(2,9,3,7,8,2,3,5,1,3,9,3,4,7))
text strlist(1,2,3,4,5,7,8,9)
textln
textln "LISTDUPLICATED"
text strlist(LISTDUPLICATED(2,9,3,7,8,2,3,5,1,3,9,3,4,7))
text strlist(2,3,7,9)
textln
textln "LISTNOTDUPLICATED"
text strlist(LISTNOTDUPLICATED(2,9,3,7,8,2,3,5,1,3,9,3,4,7))
text strlist(1,4,5,8)
forever
All these can be used with arraya, and the ARRAY() command
to merge lists like this:
drawclear white
color black
imageload emailrbcore.emf t
test = imageemftext(t)
resulta = arraysearch(test,font,arial)
resultb = arraysearch(test,bold,fontstyle)
result = array(listduplicate(@resulta,@resultb))
Result is then a list of all items that use fontstyle bold
and font arial.
New system variable @TEXTKERNSIZE, controls the size of kerning.
Can be a measurement (based on X axis), like 1pt, or 0.333pct.
Defaults to 1 (1 pixel).
FONTGAPS now supports measurements for any values. The
intercharacter gap and space gap are based on X axis, the
vertical spacing gap is based on the Y axis.
----------------------------------------------------------------------------
Thu, 30 Sep 2004
New commands for searching, and extracting results from arrays
(for use with FILEGETARRAYNAMED, FILEPUTARRAYNAMED, IMAGEEMFTEXT
and other array commands).
RESULT = ARRAYSEARCH(ARRAY,SEARCHVALUE)
RESULT = ARRAYSEARCH(ARRAY,SEARCHVALUE,FIELD)
RESULT = ARRAYSEARCH(ARRAY,SEARCHVALUE,RECORDLIST)
RESULT = ARRAYSEARCH(ARRAY,SEARCHVALUE,FIELD,RECORDLIST)
RESULT = ARRAYSEARCHNOT(ARRAY,SEARCHVALUE)
RESULT = ARRAYSEARCHNOT(ARRAY,SEARCHVALUE,FIELD)
RESULT = ARRAYSEARCHNOT(ARRAY,SEARCHVALUE,RECORDLIST)
RESULT = ARRAYSEARCHNOT(ARRAY,SEARCHVALUE,FIELD,RECORDLIST)
ARRAY is the array to search.
SEARCHVALUE is a number of string, wildcards using '*' and '?'
are valid. Comparisons are done case insensitive.
FIELD is the optional field index for two dimensional arrays.
In named arrays this can be a string, in simple numeric arrays
it would be an integer.
RECORDLIST is optional, and is one or more record numbers, either
seperate values or an array used as the list of which records to search.
RESULT = ARRAYEXTRACT(ARRAY,RECORDNUMS,RECORDNUMS...)
RESULT = ARRAYEXCEPT(ARRAY,RECORDNUMS,RECORDNUMS...)
ARRAY is the array to use as the source for extraction.
RECORDNUM is one or more record numbers, either seperate values
or an array used as the list of which records to extract (exclude).
For example:
john[0] = fred
john[1] = red
john[2] = green
john[3] = blue
david = arrayextract(john,1,2)
; david is now an array with two elements [1] and [2]
bleh = arrayexcept(john,2)
; bleh is now an array with 3 elements [0] [1] and [3]
Example using search:
drawclear white
color black
imageload emailrbcore.emf t
test = imageemftext(t)
result = arraysearch(test,bold,fontstyle)
items = arrayextract(test,@result)
for j in strlist(arrayindex(items))
textln @textposx @textposy @items[@j][text]$" "$@items[@j][fontstyle]
next
forever
----------------------------------------------------------------------------
Wed, 29 Sep 2004
Array creating in IMAGEEMFTEXT fixed to correctly index all fields
(they were not correctly indexed in yesterday's build, you had to
save the array and then load it to get the correct results).
The weight, italic and underline fields are replaced with a fontstyle
field.
possible values in fontstyle field are:
""
"italic"
"underline"
"italic underline"
"thin"
"thin italic"
"thin underline"
"thin italic underline"
"extralight"
"extralight italic"
"extralight underline"
"extralight italic underline"
"light"
"light italic"
"light underline"
"light italic underline"
"medium"
"medium italic"
"medium underline"
"medium italic underline"
"semibold"
"semibold italic"
"semibold underline"
"semibold italic underline"
"bold"
"bold italic"
"bold underline"
"bold italic underline"
"extrabold"
"extrabold italic"
"extrabold underline"
"extrabold italic underline"
"heavy"
"heavy italic"
"heavy underline"
"heavy italic underline"
The alignment field is dropped.
Example with these changes:
text,x,y,font,height,color,fontstyle
Any other,2.819,1.665,Arial,0.052,0,
marketing,2.815,1.726,Arial,0.052,0,
collateral can,2.785,1.793,Arial,0.052,0,
be produced,2.792,1.854,Arial,0.052,0,
Emailed Digital/,0.129,1.181,Arial,0.052,0,bold
Litho print PDF,0.136,1.247,Arial,0.052,0,bold
Local print,0.651,1.181,Arial,0.052,0,bold
PDF,0.711,1.247,Arial,0.052,0,bold
Expect these new commands in next build:
ARRAYSEARCH
ARRAYSEARCHNOT
ARRAYEXTRACT
ARRAYEXCEPT (reverse of ARRAYEXTRACT)
----------------------------------------------------------------------------
Tue, 28 Sep 2004
Updated datafiles from Dick.
New command IMAGEEMFTEXT, dumps all the text in an EMF image into
an array. Example:
drawclear white
imageload bmwtest.emf
test = imageemftext(bmwtest)
filedelete "c:\\test.csv"
fileputarraynamed "c:\\test.csv" test
exitnow
Some example output:
text,x,y,font,height,weight,italic,underline,align,color
Any other,2.819,1.665,Arial,0.052,400,0,0,left,0
marketing,2.815,1.726,Arial,0.052,400,0,0,left,0
collateral can,2.785,1.793,Arial,0.052,400,0,0,left,0
be produced,2.792,1.854,Arial,0.052,400,0,0,left,0
Emailed Digital/,0.129,1.181,Arial,0.052,700,0,0,left,0
Litho print PDF,0.136,1.247,Arial,0.052,700,0,0,left,0
Local print,0.651,1.181,Arial,0.052,700,0,0,left,0
PDF,0.711,1.247,Arial,0.052,700,0,0,left,0
The X, Y coordinates and the font height are in percentage of image
size (for scaling purposes).
The weight, italic, and underline values will likely change
to text fields (a "fontstyle" field).
----------------------------------------------------------------------------
Thu, 23 Sep 2004
(been working on IMAGEEMFSCRIPT and new commands to support the scripts,
not done, and in fact hunks of that code are stubbed out so I could create
this updated build)
IMAGESIZE now has two optional parameters at the end that specify a
"virtual size" used to anti-alias and adjust for font size in EMF
files.
Text in EMF files use a fixed table for spacing, it's an exact proportion of
the image size. Unfortunately fonts do not scale evenly like that, so
as you scale an EMF (particularly to smaller sizes), the text spacing
can become quite bad looking. You can use the virtual size option
in imagesize to render the EMF at a much larger "virtual" resolution
which will then be scaled down.
IMAGESIZE IMAGEBUF
IMAGESIZE XSIZE YSIZE IMAGEBUF
IMAGESIZE XSIZE YSIZE BITS IMAGEBUF
IMAGESIZE IMAGEBUF VIRTXSIZE VIRTYSIZE
IMAGESIZE XSIZE YSIZE IMAGEBUF VIRTXSIZE VIRTYSIZE
IMAGESIZE XSIZE YSIZE BITS IMAGEBUF VIRTXSIZE VIRTYSIZE
Also all IMAGESIZE calculations made based on image size
now use the original image size before any scaling.
IMAGELOAD of EMF/WMF images now fill in height and width of the image
buffer (they were defaulting to zero). The values for image
density (dots per inch) are also read from the EMF/WMF. IMAGELOAD
still does not render an EMF/WMF image, you still need to use
IMAGESIZE
This loads an EMF and displays it anti-aliased,
use original size, but render at a virtual resolution 16x larger
drawclear white
imageload emailrbcore.emf
imagesize -1 -1 emailrbcore -8 -8
imageput emailrbcore
forever
An example of the dramatic difference between a EMF rendered
directly to the window with no scaling, and one rendered at
64x the resolution:
set imagecompressed on
imageload bmwtest.emf bmw
set imagecompressed off
imageload bmwtest.emf
windowsize bmw->sizex bmw->sizey
drawclear white
imagesize -1 -1 bmwtest -8 -8
beginloop
imageput bmwtest
delay 50
windowupdate off
drawclear white
imageput bmw
windowupdate on
delay 50
endloop
The imagesize virtual size option means nothing on
images loaded with IMAGECOMPRESSED ON.
Four new elements added for IMAGES only:
IMAGE->ORIGSIZEX ; always preserved, not changed by IMAGESIZE
IMAGE->ORIGSIZEY
IMAGE->VIRTSIZEX ; set by IMAGESIZE VIRTXSIZE/VIRTYSIZE
IMAGE->VIRTSIZEY
----------------------------------------------------------------------------
Wed, 08 Sep 2004
Updated AfterGRASP Editor (AGEDIT) from Dick Brandt.
Divide by Zero error when using modulus (%) with zero fixed.
IMAGEFINDCENTER now has a more extensive search pattern. Branching
outward in a 8 pointed star pattern when enlarging the radius of
the possible center. This can result is FAR slower searches, but
gives more accurate results.
The default search RADIUS for IMAGEFINDCENTER is now the height+width
of the image divided by 128. If that is lower than 4, then 4
is used.
IMAGEFINDCENTER now returns a radius of 0 if the search failed.
IMAGEFINDCENTER's default MATCHPERCENT is increased slightly to 99.8.
----------------------------------------------------------------------------
Mon, 06 Sep 2004
Coordinate/Number detection much improved to avoid identifying strings
like "1. First line" as a number or coordinate when used with commands
like text or textfrom. A number is now defined as digits, a optional
single period, optional leading and trailing spaces or tabs,
optional scientific notation like 1.05e23, and optional hex notation.
Several TEXT options (like vertical centering) were not working with
TEXTFROM because the internal TEXTHEIGHT code was not correctly taking
the linecount into consideration (it was ignoring it). Fixed.
TEXTHEIGHT now accepts 2 additional (optional) parameters:
RESULT = TEXTHEIGHT(STRING)
RESULT = TEXTHEIGHT(STRING, OFFSET)
RESULT = TEXTHEIGHT(STRING, OFFSET, HEIGHT)
RESULT = TEXTHEIGHT(STRING, OFFSET, HEIGHT, STARTLINENUMBER)
RESULT = TEXTHEIGHT(STRING, OFFSET, HEIGHT, STARTLINENUMBER, PAGELINECOUNT)
OFFSET defaults to 1 (first character in the string)
HEIGHT defaults to 0
STARTLINENUMBER defaults to 1
PAGELINECOUNT defaults to 99999999
The STARTLINENUMBER and PAGELINECOUNT allow you to calculate the height of
sections of text. The line number refer to wordwrapped formatted final
text much like the TEXTFROM command.
IMAGECENTER now working.
IMAGEFINDCENTER now working
IMAGEFINDCENTER returns the centerX, centerY and radius of center area:
RESULTS = IMAGEFINDCENTER(IMAGE)
RESULTS = IMAGEFINDCENTER(IMAGE, CHECKRADIUS)
RESULTS = IMAGEFINDCENTER(IMAGE, CHECKRADIUS, COLOR)
RESULTS = IMAGEFINDCENTER(IMAGE, CHECKRADIUS, COLOR, MATCHPERCENT)
RESULTS = IMAGEFINDCENTER(IMAGE, CHECKRADIUS, COLOR, MATCHPERCENT, NOMATCHPERCENT)
CHECKRADIUS defaults to 4 pixels, area searched for will be a circle with
a diameter of 8.
COLOR defaults to BLACK
MATCHPERCENT defaults to 99.7 (is how close a pixel has to be to COLOR to match)
NOMATCHPERCENT defaults to 99.5 (is compensation for completely non-matching
pixels, like noise).
Example of IMAGECENTER and IMAGEFINDCENTER:
windowSize 1280 1024 32
imageload abba2.jpg
imagetrim abba2
imageput abba2
color red
drawcirclefilled imagefindcenter(abba2)
imagecenter abba2 black imagefindcenter(abba2)
drawclear green
imageput abba2
drawcirclefilled imagefindcenter(abba2)
imagepolar pantest abba2 1024
layer test panorama pantest 512, 300
layer test panning 1000/30. 1 .7 0
beginloop
layer j 580 0 text test->panoangle$" "$test->panotilt
endloop
----------------------------------------------------------------------------
Thu, 02 Sep 2004
New command IMAGEEMFSCRIPT, just testing code for now (planned to dump
an EMF file as a AfterGRASP script).
Bug in HTML/RTF text where lines following a line break done in a taller
font would mess up the line spacing on the shorter font line.
The formatting calculation was not correctly counting the LineFeeds
as a line, and falling through to the text draw, instead it was
continuing onward into other lines of text. This bug may also have
had odd side effects in calculating text height and textlines.
New commands not finished yet:
IMAGEFINDCENTER IMAGE CHECKRADIUS MATCHPERCENT COLOR
IMAGEFINDCENTER returns 3 values, the X and Y coordinates of the
image center, and the diameter of the circular center area.
IMAGE is the image buffer to search
CHECKRADIUS is the size of the rectangle of solid color to search for
(default is 3 pixels, integer value)
MATCHPERCENT is the percentage match that is acceptable (default is
95.0, floating point value)
COLOR is the color to search for (default is BLACK, color value)
IMAGECENTER IMAGE COLOR CENTERX CENTERY
IMAGECENTER adds extra pixels on whatever sides are required to make
CENTERX and CENTERY the new center of the image.
IMAGE is the image buffer to modify
COLOR is the fillcolor
CENTERX/CENTERY are the coordinates of the area within IMAGE that will
become the new center.
Example:
imageload abba1.jpg ; load fisheye view image
imagetrim abba1
imagecenter abba1 black imagefindcenter(abba1)
imagepolar pantest abba1 1024
----------------------------------------------------------------------------
Thu, 26 Aug 2004
Extra characters added at the end of a indented list with RTF text
is fixed.
----------------------------------------------------------------------------
Wed, 25 Aug 2004
Updated Install Script from Dick (registry settings for editor)
Slightly higher priority now given to thread that monitors Layers for
movement (like LAYER PANNING, or LAYER TO).
Comments are now allowed inside function calls like this:
hello(1, ;result
2,
; 3,
4)
Comments can now be defined with double forward slash '//'
(like in C/C++/Java) as well as with semicolon ';'
SET TEXTRTF ON/OFF and SET TEXTHTML ON/OFF now resets the text
code parser including the "unget" buffer used for tables. This
prevents odd weirdness when displaying non RTF text after using RTF.
----------------------------------------------------------------------------
Mon, 23 Aug 2004
Updated AGEDIT and DAT files from Dick. Edit/Preferences property sheet
is now accessible at all times, even when no project or file has been
opened. Some file associations updated to closer match those created
by the setup program.
LAYER PAN, LAYER PANORAMA now correctly remove a layer from the busy/active
list. LAYER PANTO and LAYER PANNING now removed a layer from the busy/active
list when required.
New option for HOTSPOT, the "CLICKUP" is a combination of both
LABEL and CLICKOUT. It is called when the mouse is released, either
inside the hotspot, or outside it.
The AfterGRASP compiler (AGCOMP) now allows parameters to a function to
not have commas between them. This allows statments like this:
hotspot( hvtup,
position, @arrowsposx+7, @arrowsposy, @arrowsposx+17, @arrowsposy+8,
clickdown, pansub:(0,-1,0),
clickup, stoppan,
rollimage, up_arrow
)
To be written like this:
hotspot( hvtup
position @arrowsposx+7 @arrowsposy @arrowsposx+17 @arrowsposy+8
clickdown pansub:(0,-1,0)
clickup stoppan
rollimage up_arrow
)
Bug when multiple labels of the same type are used with HOTSPOT
is fixed, so for instance this would have caused a memory leak:
hotspot hvtup fun, label notfun, position 1 2 3 4
----------------------------------------------------------------------------
Thu, 19 Aug 2004
New command LAYER PANNING used for continuous panning of a panoramic
image. It continues panning until you do a
LAYER LAYNAME PANNING
LAYER LAYNAME PANNING DELAY
LAYER LAYNAME PANNING DELAY PANANGLESTEP
LAYER LAYNAME PANNING DELAY PANANGLESTEP TILTANGLESTEP
LAYER LAYNAME PANNING DELAY PANANGLESTEP TILTANGLESTEP FIELDOFVIEWSTEP
Default values are:
DELAY is 1000/30. (1/30th of a second)
PANANGLESTEP is 1
TILTANGLESTEP is 0
FIELDOFVIEWSTEP is 0
As the panning continues:
PANANGLE wraps around at +180 and -180.
TILTANGLE reverses when the maximum (32) or minimum (-32) tilt is reached.
FIEWOFVIEW reverses when the maximum (120) or minimum (10) field of view
is reached.
LAYER PAN with no angle parameter is changed to NOT reset the angle to 0
rather it only stops any panning motion set forth with PANTO or PANNING.
New elements for reading panangle, tiltangle and fieldofview from a layer.
LAYNAME->PANOANGLE
LAYNAME->PANOTILT
LAYNAME->PANOVIEW
These elements change while PANTO and PANNING are running to match
the current angle.
Here is a working example:
drawclear red
imageload DSCF0027.JPG
imagetrim DSCF0027
imageput DSCF0027
imagepolar pantest DSCF0027 1024
layer test panorama pantest 512, 300
layer test panning 1000/30. 1 .7 0
beginloop
layer j 580 0 text test->panoangle$" "$test->panotilt
endloop
forever
----------------------------------------------------------------------------
Tue, 17 Aug 2004
The LAYER REPEAT command now supports LAYER PANTO
Priority of the Logical Not '!' operator was wrong! It was very high
priority, before most operators. This is the new corrected
priority table:
1 MEMGETBYTE
MEMGETLONG
MEMGETWORD
AT
NEGATE
INCHES
MILLIMETERS
CENTIMETERS
PERCENTAGE
POINTS
PICAS
2 ARROW
3 MULTIPLY
DIVIDE
MODULUS
4 ADD
SUBTRACT
5 STRCAT
GREATERTHAN
EQUALGREATERTHAN
LESSTHAN
EQUALLESSTHAN
6 LOGNOT
7 EQUAL
NOTEQUAL
8 AND
OR
SHIFTRIGHT
SHIFTLEFT
XOR
9 LOGAND
10 LOGOR
11 SET
12 OPENPAREN
CLOSEPAREN
CLOSEBRACE
UNTIL command now supported, syntax is:
until expression
Waits until expression is true.
Examples:
timerset test
until @test>2000
layer testlay panto 360
until !testlay->layerbusy||@mousedown
Removed a few stray commands from interpreter that were left over from when
some control commands like WAIT, WAITKEY were moved into the compiler.
More changes for RTF table tags.
----------------------------------------------------------------------------
Thu, 12 Aug 2004
New command FILEZIPAS, similar to FILEZIP, except it expects
two values for each file, the original filename, and the path/name
to use within the zip file.
For example:
drawclear white
fpath = "c:\\dhomes\\include\\"
zpath = "funnydir\\"
count = 0
for fn in drivefilelist(0,@fpath$"*.*"))
a[@count] = @fpath$@fn
inc count
a[@count] = @zpath$@fn
inc count
next
filezipas "c:\\test.zip" @a
Work started on adding these RTF tags:
\cell
\cellx
\intbl
\row
\trgaph
\trleft
\trowd
\trpaddfl
\trpaddfr
\trpaddl
\trpaddr
\trrh
Stubs added for these RTF tags:
\ansi
\ansicpg
\deff
\deflang
\fcharset
\generator
\uc
\viewkind
----------------------------------------------------------------------------
Tue, 10 Aug 2004
Bug in LAYER TEXTWIDTH fixed (wasn't accepting parameters correctly)
New DAT files from Dick for AG Editor.
AG appears to work fine with WinXP SP2.
----------------------------------------------------------------------------
Thu, 05 Aug 2004
Serious bugs in handling multiple RTF text strings are fixed. The
\RTF tag now wipes out all previous rtf parsing state information.
New function, INT() returns the integer version of a number (clearer and
more efficient than using STRPAD0() to do the same sort of thing).
Two new commands, TEXTLINES and TEXTFROM:
PAGELINECOUNT = TEXTLINES(STRING)
PAGELINECOUNT = TEXTLINES(STRING, STARTLINENUMBER)
PAGELINECOUNT = TEXTLINES(STRING, STARTLINENUMBER, PAGEWIDTH)
PAGELINECOUNT = TEXTLINES(STRING, STARTLINENUMBER, PAGEWIDTH, PAGEHEIGHTPIXELS)
TEXTFROM STRING
TEXTFROM STRING STARTLINENUMBER
TEXTFROM STRING STARTLINENUMBER PAGELINECOUNT
TEXTFROM XPOS YPOS STRING
TEXTFROM XPOS YPOS STRING STARTLINENUMBER
TEXTFROM XPOS YPOS STRING STARTLINENUMBER PAGELINECOUNT
IMAGEPOLAR now accepts a destination image:
IMAGEPOLAR SOURCEIMAGE
IMAGEPOLAR SOURCEIMAGE VIEWYSIZE
IMAGEPOLAR SOURCEIMAGE VIEWXSIZE VIEWYSIZE
IMAGEPOLAR SOURCEIMAGE VIEWXSIZE VIEWYSIZE CENTERX CENTERY
IMAGEPOLAR SOURCEIMAGE VIEWXSIZE VIEWYSIZE CENTERX CENTERY STARTRADIUS ENDRADIUS
IMAGEPOLAR XPOS YPOS SOURCEIMAGE
IMAGEPOLAR XPOS YPOS SOURCEIMAGE VIEWYSIZE
IMAGEPOLAR XPOS YPOS SOURCEIMAGE VIEWXSIZE VIEWYSIZE
IMAGEPOLAR XPOS YPOS SOURCEIMAGE VIEWXSIZE VIEWYSIZE CENTERX CENTERY
IMAGEPOLAR XPOS YPOS SOURCEIMAGE VIEWXSIZE VIEWYSIZE CENTERX CENTERY STARTRADIUS ENDRADIUS
IMAGEPOLAR DESTIMAGE SOURCEIMAGE
IMAGEPOLAR DESTIMAGE SOURCEIMAGE VIEWYSIZE
IMAGEPOLAR DESTIMAGE SOURCEIMAGE VIEWXSIZE VIEWYSIZE
IMAGEPOLAR DESTIMAGE SOURCEIMAGE VIEWXSIZE VIEWYSIZE CENTERX CENTERY
IMAGEPOLAR DESTIMAGE SOURCEIMAGE VIEWXSIZE VIEWYSIZE CENTERX CENTERY STARTRADIUS ENDRADIUS
Some default values in IMAGEPOLAR are different depending if DESTIMAGE is used.
If DESTIMAGE is not used them:
VIEWXSIZE default is current DRAWREGION width
VIEWYSIZE default is current DRAWREGION height
IMAGETRIM rewritten to scan each side using the edge color from
that side, not one common bacground color for all four sides
(unless a background color is passed as a parameter, in which
case that color is used for all four scan directions).
Updated working example:
drawclear red
imageload DSCF0027.JPG
imagetrim DSCF0027
imageput DSCF0027
imagepolar pantest DSCF0027
for tilt from -20 to 20 step 5
layer test panorama pantest 256, 200, -180 @tilt 60
layer test position 100 200
layer test panto 180 wait
delay 100
layer test panto -180 wait
delay 100
next
forever
----------------------------------------------------------------------------
Thu, 29 Jul 2004
DRAWSCANAREA and DRAWSCANAREANOT now supported.
DRAWSCANAREA X1VAR Y1VAR X2VAR Y2VAR
DRAWSCANAREA X1VAR Y1VAR X2VAR Y2VAR BACKCOLOR
DRAWSCANAREA X1VAR Y1VAR X2VAR Y2VAR BACKCOLOR PERCENT
DRAWSCANAREANOT X1VAR Y1VAR X2VAR Y2VAR
DRAWSCANAREANOT X1VAR Y1VAR X2VAR Y2VAR BACKCOLOR
DRAWSCANAREANOT X1VAR Y1VAR X2VAR Y2VAR BACKCOLOR PERCENT
Default values are:
BACKCOLOR is 0
PERCENT is 100 (it's the percentage match when comparing colors)
If percent is less than 100, then 1% totally unmatching pixels
per line scanned are allowed since the assumption it's a
photographic image that may include stray pixels.
New IMAGETRIM command used to crop solid color background from
an image. It first takes a color average of the four single
pixel wide sides of the image (top, left, right, bottom). It
then does an average of all the pixels on those four sides
that is within PERCENTBACK of that four side average. This final
average is used as the background color when determining the
area to trim off.
IMAGETRIM IMAGEVAR
IMAGETRIM IMAGEVAR BACKCOLOR
IMAGETRIM PERCENT IMAGEVAR
IMAGETRIM PERCENT IMAGEVAR BACKCOLOR
IMAGETRIM PERCENT PERCENTBACK IMAGEVAR
Default value of PERCENT is 96. It's the percentage match
when comparing with the background.
Default value of PERCENTBACK is 96. It's the percentage match
when comparing the average background color with the possible
background colors uses for a final average background color.
In the IMAGEPOLAR command, the default value for STARTRADIUS is now
the SOURCEIMAGE height multiplied by 0.096
Working example using new IMAGETRIM with IMAGEPOLAR:
drawclear red
imageload DSCF0027.JPG
imageput 0 0 DSCF0027 640 480
imagetrim DSCF0027
imagenew pantest 480*@pi 480
imageset pantest
imagepolar DSCF0027 480
imageset
delay 200
imageput pantest
for tilt from -20 to 20 step 5
layer test panorama pantest 256, 200, -180 @tilt 60
layer test position 100 200
layer test panto 180 wait
delay 100
layer test panto -180 wait
delay 100
next
forever
----------------------------------------------------------------------------
Wed, 28 Jul 2004
New IMAGEPOLAR command used to transform a polar coordinate image
(usually a fisheye view) into a panoramic view.
IMAGEPOLAR SOURCEIMAGE
IMAGEPOLAR XPOS YPOS SOURCEIMAGE
IMAGEPOLAR XPOS YPOS SOURCEIMAGE VIEWYSIZE
IMAGEPOLAR XPOS YPOS SOURCEIMAGE VIEWXSIZE VIEWYSIZE
IMAGEPOLAR XPOS YPOS SOURCEIMAGE VIEWXSIZE VIEWYSIZE CENTERX CENTERY
IMAGEPOLAR XPOS YPOS SOURCEIMAGE VIEWXSIZE VIEWYSIZE CENTERX CENTERY STARTRADIUS ENDRADIUS
Default values are:
VIEWYSIZE is half with width or height (whichever is smaller) of SOURCEIMAGE
VIEWXSIZE is PI times the VIEWYSIZE
CENTERX,CENTERY is the center of SOURCEIMAGE
STARTRADIUS is VIEWYSIZE*0.095
ENDRADIUS is the distance to the nearest edge from CENTERX,CENTERY
Crude example:
drawclear red
imageload DSCF0027.JPG
imagesize -2 -2 DSCF0027
imagenew pantest 480*@pi 480
imageset pantest
imagepolar DSCF0027 480*@pi 480 DSCF0027->sizex*.512 DSCF0027->sizey/2 DSCF0027->sizey*.095 DSCF0027->sizey*0.48
imageset
imageput pantest
for tilt from -20 to 20 step 5
layer test panorama pantest 256, 200, -180 @tilt 60
layer test position 100 200
layer test panto 180 wait
delay 100
layer test panto -180 wait
delay 100
next
forever
IMAGEPANORAMA command now supports source images that are not 32bits
per pixel.
New SCRIPTCOMPILE command, non-functional (yet), intented to eventually replace
AGCOMP program and allow direct execution of text scripts in the field.
----------------------------------------------------------------------------
Wed, 21 Jul 2004
LAYER TO now supports floating point numbers for STEP and DELAY.
Also, in LAYER TO, DELAY now defaults to 1000/60 (used to be 10).
IMAGEPANORAMA sped up (destination image buffer is no longer cleared
before being filled).
New LAYER commands:
LAYER PANORAMA, LAYER PAN and LAYER PANTO for use with panoramic view images:
LAYER LAYNAME PANORAMA SOURCEIMAGE
LAYER LAYNAME PANORAMA SOURCEIMAGE VIEWXYSIZE
LAYER LAYNAME PANORAMA SOURCEIMAGE VIEWXSIZE VIEWYSIZE
LAYER LAYNAME PANORAMA SOURCEIMAGE VIEWXSIZE VIEWYSIZE PANANGLE
LAYER LAYNAME PANORAMA SOURCEIMAGE VIEWXSIZE VIEWYSIZE PANANGLE TILTANGLE
LAYER LAYNAME PANORAMA SOURCEIMAGE VIEWXSIZE VIEWYSIZE PANANGLE TILTANGLE FIELDOFVIEW
LAYER LAYNAME PAN
LAYER LAYNAME PAN PANANGLE
LAYER LAYNAME PAN PANANGLE TILTANGLE
LAYER LAYNAME PAN PANANGLE TILTANGLE FIELDOFVIEW
LAYER LAYNAME PANTO
LAYER LAYNAME PANTO PANANGLE
LAYER LAYNAME PANTO PANANGLE TILTANGLE
LAYER LAYNAME PANTO PANANGLE TILTANGLE FIELDOFVIEW DELAY
LAYER LAYNAME PANTO PANANGLE TILTANGLE FIELDOFVIEW DELAY STEP
Default values are:
VIEWXYSIZE is the height of SOURCEIMAGE
PANANGLE is 0 (in degrees)
TILEANGLE is 0 (in degrees)
FIELDOFVIEW is 70 degrees
DELAY is 1000/30
STEP is 2.5
All use high quality scaling except PANTO which uses nearest neighbor
pixel scaling until the last frame (which uses the high quality scaling).
Working example:
drawclear red
imageload kitchen.jpg
for tilt from -20 to 20 step 5
layer test panorama kitchen, 256, 200, -180 @tilt 60
layer test position 100 200
layer test panto 180 wait
delay 200
layer test panto -180 wait
delay 200
next
forever
----------------------------------------------------------------------------
Sun, 18 Jul 2004
New IMAGEPANORAMA command for use with panoramic view images:
IMAGEPANORAMA XPOS YPOS SOURCEIMAGE VIEWXSIZE VIEWYSIZE PANANGLE TILTANGLE FIELDOFVIEW
Default XPOS is 0
Default YPOS is 0
Default PANANGLE is 0 (in degrees)
Default TILEANGLE is 0 (in degrees)
Default FIELDOFVIEW is 70 degrees
Working example:
drawclear red
imageload kitchen.jpg
for tilt from -20 to 20 step 5
set imagefastscale on
for ang from -180 to 180 step 2
imagepanorama center center kitchen, 512, 512, @ang, @tilt
next
set imagefastscale off
for ang from 180 to -180 step -5
imagepanorama center center kitchen, 512, 512, @ang, @tilt
next
next
forever
The IMAGEFASTSCALE variable is used to determine the scaling quality.
New modular compile OPTION PANVIEW
----------------------------------------------------------------------------
Wed, 07 Jul 2004
Crashing bug in imageload and other loading commands when the filename
is NULL is fixed.
----------------------------------------------------------------------------
Tue, 29 Jun 2004
Wierd compiler bug with Inline functions worked around in the CopyDRAWINFO
internal function when called from IMAGEPUT with scaling. The bug was
causing a Windows GDI Object leak so that eventually you would run out
of objects, and no new images could be loaded or created.
----------------------------------------------------------------------------
Thu, 24 Jun 2004
FILESHORTNAME command is now supported, takes any number of filenames
with path and returns the short (8.3) version of them.
drawclear white
color black
set textkern off
textln fileshortname("c:\\program files")
forever
New system variable SET TEXTKERN, defaults to ON, which is
the same as STRASC("~").
It's the character used for text kerning (backspacing 1 pixel).
SET TEXTKERN OFF
SET TEXTKERN ON ; same as STRASC("~")
SET TEXTKERN 255
SET TEXTKERN STRASC("~")
New command STRVARNAME, it takes a string and strips out all
invalid characters for a variable name, as well as converting
it to lowercase. If the resulting name is all digits, then
an underline is added as a prefix. If no valid name can
be constructed, then a CRC32 of the name is used as a HEX
string with a leading "_". Example:
drawclear white
color black
srcpath = "c:\\images\\"
list = driveFileList(0,@srcpath$"*.jpg")
set variables on
for fname in @list
testname = @srcpath$"TEST "$@fname
testvar = strvarname(@testname)
imageload @srcpath$@fname @testvar
imagesize 200 200 @testvar
imagesavejpeg 80 @testname
imagefree @testvar
next
forever
----------------------------------------------------------------------------
Wed, 23 Jun 2004
Bug in Modular compiler when dealing with TEXT and no RTF Text, all
intercharacter spacing was lost. Fixed.
Two new commands supporting BLOWFISH encryption (very fast):
STRENCRYPTBLOWFISH
STRDECRYPTBLOWFISH
Exactly the same syntax as the STRENCRYPTAES and STRDECRYPTAES commands.
The password is transformed via SHA into a 256bit cypher key for BlowFish.
You can read more about the free, unpatented BlowFish Algorithm here:
http://www.schneier.com/blowfish.html
----------------------------------------------------------------------------
Tue, 22 Jun 2004
SET FILEDIALOGPATH was broken, was treating the path as a integer instead
of a string.
Tabs created by HTML tabs (like - ), and RTF tabs are now special cased
as HTMLTAB and RTFTAB so if both TEXTHTML ON and TEXTRTF ON are on.
Indenting problem with
- where the
- is on the same line as the
text with no breaks is fixed.
Two new system variables:
SET FILESTRINGSTART
SET FILESTRINGEND
They apply to these commands:
FILEGETVARIABLES
FILEGETARRAY
FILEGETARRAYNAMED
FILEPUTARRAY
FILEPUTARRAYNAMED
FILEPUTVARIABLES
Both default to @QUOTE (double quote character).
Example that loads in a variables list from TEST.TXT, displays
the list of variables, and then writes out the new list with
different delimiters (using "<<" for the start of a string
and ">>" for the end of a string).
drawclear white
color black
set textwrap off
global filegetvariables(test.txt)
set list array(filegetvariables(test.txt))
for vname from 1 count list->Size/2 step 2
arrayremove list @vname
next
textln @list
textln
set filestringstart "<<"
set filestringend ">>"
fileputvariables(output.txt, @list)
textln fileget(output.txt)
local filegetvariables(output.txt)
set variables on
forever
----------------------------------------------------------------------------
Thu, 17 Jun 2004
FONTLOAD was broken yesterday (build wasn't publicly announced since it was
a rush job anyway).
FILESETDATETIME tested.
----------------------------------------------------------------------------
Wed, 16 Jun 2004
FILESETDATETIME support added (untested, been a busy day)
Multiple problems with FONTDEFINE caused by all the font changes yesterday
are fixed (a second font handle is now created when the font is rendered).
----------------------------------------------------------------------------
Tue, 15 Jun 2004
More error checking added for when the windows GDI system runs out of
space.
Resource leak in the selection of windows HFONT handles is fixed
(each selectobject is now tracked with backreferences).
----------------------------------------------------------------------------
Sun, 13 Jun 2004
The support for reading the DEVMODE structure when you use something
besides the default printer (by using SET PRINTNAME ...) has been
expanded to use an alternate method when the usual method fails.
Fixed GPF bug when SET PRINTNAME is used with an incorrect name (no
printer with that name is available).
Updated DAT files from Dick for Editor.
----------------------------------------------------------------------------
Thu, 10 Jun 2004
The following system variables for printing are now functional:
@PRINTNAME
@PRINTDRIVER
@PRINTPORT
If you set any of these variables before using any PRINT commands,
you can force AfterGRASP to use a different printer.
Normally you would only change @PRINTNAME to switch printers, the
@PRINTDRIVER and @PRINTPORT are for more advanced tasks.
drawclear white
color black
set printname "Postscript to a file"
set printfilename "c:\\test.ps"
printsettings dpi 600
printstart
printstartpage
printset
color black
for i from 9 to 60 step 4
winfont "Times" 0 topoints(@i) 90
text "Times "$@i$"pt"
fontdefine "Times" 0 topoints(@i) 90
textln 50pct @textposy "Times "$@i$"pt"
next
printendpage
printend
fontdefine "Times" 20
color black
textln "printname="$@printname
textln "printport="$@printport
textln "printdriver="$@printdriver
forever
----------------------------------------------------------------------------
Fri, 04 Jun 2004
More Layer thread problems fixed. All the code which handles the
active or busy layer queues is now centralized in a single sychronous
function.
More time is now given up by the Layer position adjustment thread to
make the foreground animation smoother. This eliminate a large amount
of stutter and other jumps.
----------------------------------------------------------------------------
Wed, 02 Jun 2004
Fixed several structural problems in the handling of a large number
of LAYERs. Rewrote most of the layer processing QUEUE code, and
added a lot of error checking.
Restored previous (lower) limits on number of active layers
Maximum number of layers that can be updated at once: 1024
Maximum number of layers that can be animated at once: 4096
----------------------------------------------------------------------------
Tue, 01 Jun 2004
Serious bugs in SET VARIABLES ON when used with a large number of
variables (hundreds) are fixed. The entire dialog update queue
system used for DEBUG and VARIABLES has been stripped out. This
drasticly speeds up their update speed, and fixes numerous little
quirks.
VARIABLES dialog now displays the position, size, frame number,
number of frames, and active/busy flags for LAYERs.
VARIABLES dialog now preserves the position of the scroll list
so it doesn't keep jumping back to the top.
LAYER updating now causes the VARIABLES dialog to update.
The maximum number of layers that can be updated at once has been increased
from 1024 to 4096
The maximum number of layers that can be animated at once has been
increased from 8096 to 16384.
----------------------------------------------------------------------------
Mon, 31 May 2004
SET TEXTHTML ON now supports the following tags:
-
Example:
drawclear white
color black
set texthtml on
text "
Hello
- One
Second
- A
- B
- Uno
- Duo
- C
- Two
- Three
"
forever
----------------------------------------------------------------------------
Thu, 27 May 2004
The pct measurement is now always based on the full window size, not
the current drawregion.
IMAGESIZE now supports measurements and percentages for the image size.
SET IMAGECOMPRESSED ON now affects loading of EMF and WMF files. They are
no longer rendered as bitmaps, but rather drawn directly to the print
device context. This allows much nicer looking vector graphics at full
resolution without the loss from the bitmap translation.
Here is a working example:
drawclear white
color black
printsettings dpi 600
printstart
printstartpage
printset
drawclear white
color black
set imagecompressed on
imageload Emailrbcore.emf
imagesize 100pct 50pct Emailrbcore
imageput Emailrbcore
printendpage
printend
exitnow
----------------------------------------------------------------------------
Wed, 26 May 2004
DRAWREGION now correctly works with percentage measurements (they are
now correctly based on the entire window size, not the previous drawregion).
New command FILEBUSY, determines if a file is "busy", tries to open a
file for reading in locked mode to determine if the file is available
(could be moved, deleted, or if another task is done writing to it).
FILEBUSY will return @TRUE if any error happens trying to access the file
including a bad path or missing file. It only returns @FALSE when the
file exists and can be accessed.
----------------------------------------------------------------------------
Mon, 24 May 2004
FileDelete now supports Wildcards.
TEXTWIDTH() was miscalculating the width of lines ending in a CR/LF.
The worst effect of this was miswrapped LAYER TEXT (last character
would be forced to wrap for no reason).
New FILESETSECURITY command added, Syntax is:
FILESETSECURITY FILENAME OWNER TYPE
TYPE can be ALL, DELETE, EXECUTE, READ or WRITE
for example:
filesetsecurity "c:\\agqueue" "Everyone" all
If TYPE is left out, it defaults to ALL.
Return value is 0 if success.
----------------------------------------------------------------------------
Sun, 23 May 2004
TEXTLN now supports all the coordinate options that TEXT supports
such as measurements 50pct, or CENTER/LEFT/RIGHT/TOP/BOTTOM.
The PRINTSETTINGS command now has a "DPI" option that requires a
number. like PRINTSETTINGS DPI 300.
For example:
drawclear white
printsettings dpi 144
printstart
printstartpage
printset
drawclear white
color black
for i from 9 to 69 step 5
winfont "Times" 0 topoints(@i) 90
text "Times "$@i$"pt"
fontdefine "Times" 0 topoints(@i) 90
textln 50pct @textposy "Times "$@i$"pt"
next
printendpage
printend
forever
-----------------------------------------------------------------------------
Thu, 20 May 2004
The \rtf keyword in TEXTRTF now resets all RTF variables (fonts, colors,
font style, tabs, and so on).
Added limited support for "Paragraph Numbering" keywords in RTF. Only those
generated by WordPad, so:
\pn
\pnf
\pnindent
\pnlvlblt
\pntext
\pntxta
\pntxtb
Basicly this means numbering doesn't even number, it only indents, and
uses the text from \pntxtb.
Apparently Microsoft Word doesn't even generate the "Paragraph Numbering"
tags in the more recent versions, only WordPad.
-----------------------------------------------------------------------------
Mon, 17 May 2004
TEXTRTF now supports multiple tabstops (up to 32), and the default tab stops
are every 1/2 inch if none are specified.
A serious bug when lots of font changes occur during HTML or RTF text
has been fixed. The whole mechanism for keeping track of the current HTML
or RTF font variable's name has been ripped out. This also fixes a
memory leak in the RTF font variable's name.
Performance of displaying RTF text is now quite a bit quicker since
the check for font changes is now only don't when RTF tags actually
change the font name/style/size.
Numerous fixes to TEXTHEIGHT() function to match the same height
produced by TEXT with TEXTRTF or TEXTHTML. This includes
the tracking of multiple character heights on the same line,
mixed text and graphics, and word wrap bugs.
Problems with RTF and HTML parsing near a word wrap are fixed
(some tags were being repeated).
RTF and HTML parsing errors after a linebreak are fixed (introduced in
previous build).
RTF Font size is now calculated as half points (it was done as half
pixels before). The variable name used for the font now uses the
full halfpoint size as the suffix, so for instance Arial 12pt Bold
would be stored in "arial24b".
Handling of text near a linebreak was sometimes putting the RTF
Parser into an infinite loop. Fixed.
Fixed bug in TextHeight with TEXTRTF and start of paragraph indenting.
-----------------------------------------------------------------------------
Thu, 13 May 2004
RTFTEXT now recognizes left indent, first left indent, and
now correctly spaces RTF Tabs.
Formatting of TEXT is rewritten to always happen one line at a time.
Previously it would do the formatting for the entire block of
text if there was no word wrap. This caused all kinds of problems
for RTF and HTML text.
Parsing of TEXT for formatting is sped up a bit (extra code
required for HTML and RTF is now bypassed in @TEXTWRAP support).
MODULAR option for RTFTEXT fixed.
RTFTEXT support of justification improved.
More touch up to RSA public key code.
Start of including of Panoramic reverse transform code (like a reverse
wide angle lens).
-----------------------------------------------------------------------------
Tue, 04 May 2004
Initial code for RSA public key encryption added (with support for 4096
bit keys).
RTFTEXT now recognizes the \TX tag and changes the current tabsize.
Crash after an RTF parsing error message is displayed is fixed.
TEXTRTF wasn't handling HEX characters (would give RTF parse error).
TEXTRTF HEX defined characters were being skipped.
FONTSTYLE INIT and WINFONTSTYLE INIT, now reset the number of
characters to 255 (they were setting it to 127).
FONTSTYLE UNDERLINE now eliminates the fore and aft space around each
character, and includes that space in the character cell. This forces
the underline to be drawn connecting characters in a solid line.
-----------------------------------------------------------------------------
Sun, 02 May 2004
GLPRO encryption commands STRENCRYPT and STRDECRYPT are now supported:
RESULT = STRENCRYPT(STRING
RESULT = STRENCRYPT(PASSWORD,STRING)
STRENCRYPT PASSWORD ADDRESS LENGTH
RESULT = STRDECRYPT(STRING)
RESULT = STRDECRYPT(PASSWORD,STRING)
STRDECRYPT PASSWORD ADDRESS LENGTH
New commands, all oriented twords cryptography. They don't encode
encrypted data as HEX (the GLPRO STRENCRYPT doubled the string size
when it encrypted).
STRENCRYPTAES128
STRDECRYPTAES128
STRENCRYPTAES256
STRDECRYPTAES256
STRCRYPTRC4
STRMD5
STRSHA1
STRSHA2
MEMGETBYTES
MEMSETBYTES
The STRENCRYPT* and STRCRYPTRC4 all have the same syntax, they accept:
RESULT = CRYPTCOMMAND(STRING)
RESULT = CRYPTCOMMAND(PASSWORD,STRING)
CRYPTCOMMAND PASSWORD ADDRESS LENGTH
AES is the NIST standard (FIPS) Publication 197 encryption
Find more info on AES here:
http://en.wikipedia.org/wiki/AES
For AES128, the PASSWORD is expanded to a 128bit key using
an MD5 hash.
For AES256, the PASSWORD is expanded to a 256bit key using
a SHA2 hash.
The STRMD5, STRSHA1, STRSHA2 all have the same syntax as
STRCRC32. They produce different size hashes:
MD5 128bit 16 byte result
SHA1 160bit 20 byte result
SHA2 256bit 32 byte result
The return result is binary data, it is not hex (the
description of STRMD5 from yesterday is incorrect).
If you'd like the return in HEX, you can use STRHEX
to convert it:
strlower(strhex(strmd5(@string))
This will give a string identical to that produced by
the standard MD5SUM utility.
Two new MEM commands for dealing with binary strings
(not text, not NULL terminated).
RESULT = MEMGETBYTES(ADDRESS,LENGTH)
MEMSETBYTES ADDRESS STRING STRING STRING STRING
Example of new crypto functions:
windowsize 800 600 32
drawclear white
color black
set txt fileget(test.rtf)
; pad the string to a multiple of 16 bytes so that the checksum test will work
memnew tmpbuf (strlen(@txt)+15)&-16
memsetbytes @tmpbuf @txt
txt = memgetbytes(@tmpbuf, tmpbuf->len)
textln hex(strcrc32(@txt))
textln strlower(strhex(strmd5(@txt)))
textln strlower(strhex(strsha1(@txt)))
textln strlower(strhex(strsha2(@txt)))
tmp = strencryptaes256("foolish",@txt)
textln
textln "AES256"
textln strlower(strhex(strsha2(@tmp)))$" "$strlen(@tmp)$" "$strlen(@txt)
textln strlower(strhex(strsha2(strdecryptaes256("foolish",@tmp))))
tmp = strencryptaes128("foolish",@txt)
textln
textln "AES128"
textln strlower(strhex(strsha2(@tmp)))$" "$strlen(@tmp)$" "$strlen(@txt)
textln strlower(strhex(strsha2(strdecryptaes128("foolish",@tmp))))
tmp = strcryptrc4(strmd5("foolish"),@txt)
textln
textln "RC4"
textln strlower(strhex(strsha2(@tmp)))$" "$strlen(@tmp)$" "$strlen(@txt)
textln strlower(strhex(strsha2(strcryptrc4(strmd5("foolish"),@tmp))))
tmp = strencrypt("foolish",@txt)
textln
textln "RC4 GLPRO"
textln strlower(strhex(strsha2(@tmp)))$" "$strlen(@tmp)$" "$strlen(@txt)
textln strlower(strhex(strsha2(strdecrypt("foolish",@tmp))))
set textrtf on
textln @txt
forever
-----------------------------------------------------------------------------
Thu, 29 Apr 2004
STRCRC32 command now supported.
New command STRMD5, works much like STRCRC32 except it returns a
128bit MD5 checksum in hex (FAR more accurate than a 32bit CRC).
The results match the common MD5SUM command.
You can read more about MD5SUM here:
http://en.wikipedia.org/wiki/Md5sum
Because the String operators in AfterGRASP generally do NOT depend on a
trailing null character (like most did in GLPRO), you can use STRCRC32
and STRMD5 on binary data, for instance an entire file read in with the
FILEGET command.
For example:
drawclear white
color black
set txt fileget(test.rtf)
textln hex(strcrc32(@txt))
textln strmd5(@txt)
forever
Wierd intermittent bug with text not being displayed caused by uninitialized
data from the stack being used for the text line height in some cases is
fixed. (Thanks to Vicky for writing an example I could use to repeat the
bug inside a debugger).
This also showed up as a bug in the display in AGEXE where text would
all rapidly scroll up on the bottom line of the window.
Stack overflow caused by very complex RTF or HTML files is now fixed,
a single line of text can now be 32k bytes long, and still correctly
calculate the line height at a wrap point (beyond that, it just uses
the height of the last word beyond the wrap point).
-----------------------------------------------------------------------------
Mon, 26 Apr 2004
The INPUT commands (including original INPUT/INPUTLINE, and new INPUTNEW,
INPUTCHECK, and INPUTFREE) now correctly include the LAYER commands required
to draw the blinking cursor.
SET RTFTEXT now supports and displays font face, font size, text color,
background color, bold, italic, underline, left, right, center, and
spread justification. (there are still bugs in the justifcation support).
Changed some VC Compile optimizations to prevent a wierd crashing bug.
-----------------------------------------------------------------------------
Wed, 21 Apr 2004
New system variable @TEXTRTF, works much like SET TEXTHTML ON variable.
New modular option RTFTEXT, works much like HTMLTEXT option.
RTF parsing is in, but font changes are not acted upon yet:
drawclear white
color black
set txt fileget(test.rtf)
textln @txt
textln
set textrtf on
textln @txt
forever
So this displays the original text with all the RTF tags stripped
out.
If TEXTHTML and TEXTRTF are both turned on, the HTML is parsed
first, then the text with HTML tags removed is parsed as RTF.
-----------------------------------------------------------------------------
Wed, 14 Apr 2004
New system variable @PRINTFILENAME, is the default filename for
printer drivers that write to a file. In WinXP it's in the "Ports"
page of a printer's settings, where the "FILE:" port is chosen for
a printer. This variable has to be set before the PRINTSTART command
is used since it's used for the lpszOutput field of DOCINFO structure
passed to windows when the PRINTSTART command is executed.
One use of @PRITNFILENAME is to create a PostScript output file without
prompting the user for a filename.
IMAGEPUT now supports measurements (like 2in or 7pt) for the second
pair of coodinates (scaled images).
Bug when either of the second coordinates in IMAGEPUT with scale are lower
than the first is fixed.
When BI_JPEG images are output to a printer (with PRINTSET/IMAGEPUT or
PRINTIMAGE), and BI_JPEG DIB support is not available (it virtually never is),
and the output printer is PostScript compatible (as some PDF generators are)....
then the JPEG is injected into the PostScript in encapsulated format using
the original JPEG file. This allows printing of CMYK Images with their
original color correction info with no loss of quality. Multiple BI_JPEG
images can be injected.
The PostScript Injection code can be left out of the runtime with the
OPTION PRINT OFF modular compiler option.
PostScript Injection tested (and working) with Microsoft PostScript Driver
setup to write to a file, and with PDF995.
-----------------------------------------------------------------------------
Wed, 07 Apr 2004
Vertical spacing on the first character after switching to a taller font is
fixed.
Start of PostScript injection for BI_JPEG images is in place (and
not working yet).
-----------------------------------------------------------------------------
Tue, 06 Apr 2004
New crashing bug in gradient fill is fixed.
------------------------------------------------