home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Spanish Scene 4
/
SpanishScene4.iso
/
Programas
/
EsteveBoix_Ind
/
tablePlugv12.lha
/
tablePlug12
/
rx
/
ae_border.tpx
< prev
next >
Wrap
Text File
|
1999-10-11
|
1KB
|
69 lines
/*
ae_border.tpx v2.0 © 1999 Esteve Boix
Uses ArtEffect to load and scale the image, and
paints a border of any color around it.
Tested with ArtEffect3, should work on v2 (and v1 ???).
Args: SIZEX SIZEY BORDER_CLR_R BORDER_CLR_G BORDER_CLR_B BORDER_WIDTH JPEG_COMPRESSION
Where:
SIZEX, SIZEY Size in pixels of the thumbnail
BORDER_CLR_R Border R color
BORDER_CLR_G Border G color
BORDER_CLR_B Border B color
BORDER_WIDTH Size of the border
JPEG_COMPRESSION Well...
*/
options results
parse arg maxsizex maxsizey cr cg cb border compression infile outfile
infile=strip(infile)
outfile=strip(outfile)
address 'ArtEffect'
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-border comp-border
end
else do
/* No */
comp2=trunc((maxsizey/y)*x)
scalepic comp2-border maxsizey-border
end
get stem size. pictureinfo
setcolor r cr g cg b cb bg
setcolor r cr g cg b cb
scalecanvas newwidth (size.width+(border*2)) newheight (size.height+(border*2)) xoff border yoff border
/* And save the image */
SavePic '"'outfile'"' plugin 'JFIF-JPEG' quality '"'||compression||'"'
ClosePic
UnLockGui