home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Spanish Scene 4
/
SpanishScene4.iso
/
Programas
/
EsteveBoix_Ind
/
tablePlugv12.lha
/
tablePlug12
/
rx
/
ae_shadow.tpx
< prev
next >
Wrap
Text File
|
1999-10-11
|
2KB
|
90 lines
/*
ae_shadow.tpx v2.0 © 1999 Esteve Boix
Uses ArtEffect to load and scale the image, and then
casts a shadow over a any background color.
Requires ArtEffect v3+
Args: SIZEX SIZEY JPEG_COMPRESSION OFFSET SEC_MARGIN BGCOLOR_R BG_COLOR_G BGCOLOR_B
Where:
SIZEX, SIZEY Size in pixels of the thumbnail WITHOUT THE SHADOW (sorry)
JPEG_COMPRESSION Well...
OFFSET Offset in pixels of the shadow
SEC_MARGIN A margin added to the image so that the blur effect of
the shadow won't be clipped. Normally should be 2 or 3
BGCOLOR_R Background color R value
BGCOLOR_G Background color G value
BGCOLOR_B Background color B value
*/
options results
address 'ArtEffect'
parse arg maxsizex maxsizey compression offset secmargin bgr bgg bgb infile outfile
infile=strip(infile)
outfile=strip(outfile)
LockGui
LoadPic '"'infile'"'
/* Obtain info about the image */
get stem size. pictureinfo
x = size.width
y = size.height
/* ...and calculate the thumbnail resolution */
comp=trunc((maxsizex/x)*y)
if comp<=maxsizey then do
scalepic maxsizex comp
end
else do
/* No */
comp2=trunc((maxsizey/y)*x)
scalepic comp2 maxsizey
end
/* Obtain info about the image */
get stem size. pictureinfo
x = size.width
y = size.height
layer append
scalecanvas newwidth (x+offset+(secmargin*2)) newheight trunc(y+offset+(secmargin*2)) xoff secmargin yoff secmargin
setcolor r bgr g bgg b bgb
rectangle 0 0 (x+offset+(secmargin*2)) (y+offset+(secmargin*2)) pt fill str 100
setcolor r 0 g 0 b 0
rectangle (offset+secmargin) (offset+secmargin) (x+offset+secmargin) (y+offset+secmargin) pt fill str 100
domethod gaussian
CloseWindow Plugins
layer moveto 0
/* And save the image */
SavePic '"'outfile'"' plugin 'JFIF-JPEG' flatten quality compression
ClosePic force
unlockgui