home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga MA Magazine 1997 #3
/
amigamamagazinepolishissue03-1
/
my_favourite
/
imagefx_add_ons
/
pcd-overview.lha
/
pcd-overview.ifx
next >
Wrap
Text File
|
1996-10-12
|
3KB
|
151 lines
/*
* Arexx Program created by Les Hewitt Oct/1996
*/
call addlib('rexxsupport.library',0,-30,0)
OPTIONS RESULTS
Width = 800
Height = 600
OVdir = "RAM:" /* this is the directory where the requester starts
* from the first time you use the script. It
* remembers where you where for the next time you
* use the script untill you switch off or reboot
* your Amiga. */
IF OPEN(OViewDIR, "Env:OViewDIR", R) then do
OVdir = (READLN(OViewDIR))
call CLOSE OViewDIR
END
if OVdir = '"wrong"' then OVdir = 'RAM:'
/* --- GET DIR LISTS --- */
address command 'c:echo >t:List1.tmp "~~~EndOfList~~~"'
do forever
RollScreenUp Height
address command 'requestfile >env:OViewDIR title "Select Directory " drawer 'OVdir' drawersonly noicons pubscreen "IMAGEFX.1"'
RollScreenDown
IF OPEN(OViewDIR, "Env:OViewDIR", R) then do
OVdir = (READLN(OViewDIR))
call CLOSE OViewDIR
END
message OVdir
address command 'c:list >t:List.tmp 'OVdir' nohead quick lformat "%P%N"'
address command 'c:join t:List.tmp t:List1.tmp as t:List2.tmp'
RequestResponse 'Do you want to add another directory?'
IF rc ~= 0 THEN break
end
RequestResponse 'Edit file list?.'
IF rc = 0 THEN address command 'ced t:List2.tmp'
RequestResponse 'Sort file list?.'
IF rc = 0 THEN DO
address command 'sort t:List2.tmp t:List2.tmp'
END
/* --- Output Picture --- */
message 'Possible Total Pix: 4 9 16 25 36 49 64 81 100'
RequestSlider '"Number of pictures across and down:"' 2 10 8
IF rc ~= 0 THEN EXIT 0
xx = result
RequestFile '"SAVE as 24BIT JPEG Picture:"'
IF rc ~= 0 THEN EXIT 0
outpic = result
RequestSlider '"Enter Quality (Highest Quality = 100%)"' 1 100 85
IF rc ~= 0 THEN EXIT 0
Quality = result
/* ---- Hard Work ---- */
message xx*xx' Pictures'
REDRAW OFF
UNDO OFF
KillBuffer Force
KillSwap
KillAlpha
KillUndo
KillBrush
CreateBuffer Width Height 0 0 0 1 1 100 100 FORCE
ClearBuffer 255 255 255 FORCE
REDRAW ON
REDRAW OFF
IF OPEN(InFile, "T:List2.Tmp", R) then do
tx = xx*xx
wx = Width/xx
hx = Height/xx
ww = wx/2
hh = hx/2
wb = 96*wx/100
hb = 96*hx/100
wc = wb/2
hc = hb/2
number = 1
do j = 0 to xx-1
REDRAW OFF
do i = 0 to xx-1
if EOF(InFile) then leave j
inpic = (READLN(InFile))
if inpic = "" then leave j
if inpic = "~~~EndOfList~~~" then leave j
message inpic' pic 'number
LoadBrush '"'inpic'"' FORCE
Scale wb hb
BrushHandle wc hc
NewArea
AddArea ww+(wx*i) hh+(hx*j)
FreeDraw
number = number + 1
if number > tx then leave j
END i
REDRAW ON
END j
Redraw ON
/* Menu Render */
/* SetRender CyberGraphics.030 */
message 'Rendering'
Render Go
message 'Saving JPEG'
SaveBufferAs JPEG '"'outpic'"' Quality
Render CLOSE
call CLOSE InFile
END
address command 'delete >nil: t:List.tmp t:List1.tmp t:List2.tmp'
UNDO ON
Redraw ON
Message 'Finished'
address command 'echo >speak: Finished'
EXIT