home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Spanish Scene 4
/
SpanishScene4.iso
/
Programas
/
EsteveBoix_Ind
/
tablePlugv12.lha
/
tablePlug12
/
rx
/
ae_blackb.tpx
next >
Wrap
Text File
|
1999-10-11
|
1KB
|
65 lines
/*
ae_blackb.tpx v1.1 © 1999 Esteve Boix
Uses ArtEffect to load and scale the image, and
paints a black border around it.
Tested with ArtEffect3, should work on v2 (and v1 ???).
Args: SIZEX SIZEY JPEG_COMPRESSION
Where:
SIZEX, SIZEY Size in pixels of the thumbnail
JPEG_COMPRESSION Well...
*/
options results
parse arg maxsizex maxsizey 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 comp
end
else do
/* No */
comp2=trunc((maxsizey/y)*x)
scalepic comp2 maxsizey
end
/* Black rectangle */
get stem size. pictureinfo
setcolor r 0 g 0 b 0
changebrush sw 1 sh 1
rectangle 0 0 (size.width-1) (size.height-1) pt pen str 100
/* And save the image */
SavePic '"'outfile'"' plugin 'JFIF-JPEG' quality '"'||compression||'"'
ClosePic
UnLockGui