home *** CD-ROM | disk | FTP | other *** search
- /*
- Visual FX
- For
- Image FX
- SetUp Script
- Written By J.L. White
-
- (C)1997 Merlin's Software
-
- */
-
- parse arg Num Frames
- options results
- address "IMAGEFX.1"
- ReDraw On
- Quotes = '22'X
-
- RequestResponse "Do You Need Instructions?"
- if rc = 0 then do
- call Docs()
- end
-
- if exists("libs:flyer.library") then do
- if (POS('PROJECT_REXX_PORT',SHOW('Ports')) =0) then do
- RequestNotify 'Flyer Must Be Running First!'
- exit
- end
- call OpenFlyStuff()
-
-
- Gadget.1 = 'D/110/22/120/ImageA Type/4/FLYER CLIP/FLYER STILL/FRAME/SEQUENCE'
- ComplexRequest '"Visual FX SetUp Options"' 1 Gadget 250 60
- if rc ~= 0 then do
- call CloseStuff()
- exit 0
- end
- else do
- IAType = RESULT.1
- end
-
- call GetA()
- end
- else do
- Gadget.1 = 'D/110/22/120/ImageA Type/2/FRAME/SEQUENCE'
- ComplexRequest '"Visual FX SetUp Options"' 1 Gadget 250 60
- if rc ~= 0 then do
- call CloseStuff()
- exit 0
- end
- else do
- IAType = RESULT.1+2
- end
-
- call GetA()
- end
-
- if FlyOn = 1 then
- call CloseStuff()
- Color = 1
- Border = 0
-
-
- Gadget.1 = ' Select Border Options! '
- Gadget.2 = ' No Border '
- Gadget.3 = ' Solid Border Color '
- Gadget.4 = ' Beveled Scrolling Image '
- Gadget.5 = ' Beveled Picture Edge '
- ListRequest 5 Gadget
- BorderType = -1
- if result = 2 then BorderType = -1
- if result = 3 then BorderType = 0
- if result = 4 then BorderType = 1
- if result = 5 then BorderType = 2
-
- XOff = 0
- YOff = 0
-
- if BorderType = 0 then do
- ActiveColor 0
- RequestNotify "Click On Color To Use For Border Then Click "Quotes"Okay"Quotes""
- ActiveColor
- Color = result
- ActiveColor 1
- NumA = 0
- NumB = 20
- NumC = 7
- RequestSlider '"Enter Thickness Of Border!"' NumA NumB NumC
- Border = Result
- end
-
- if BorderType = 1 then do
- LoadBuffer "VFXIFX:Images/Pics/Seamless.Pic" Force
- RequestNotify "Look At Examples For FileName Then Click "Quotes"Okay"Quotes""
- RequestFile '"Select File To Use For Border!" "VFXIFX:Images/Seamless" ""'
- BrushName = result
- NumA = 0
- NumB = 20
- NumC = 10
- RequestSlider '"Enter Thickness Of Border!"' NumA NumB NumC
- Border = Result
-
- text1 = '"Move X"'
- text2 = '"Move Y"'
- Gadget.1 = 'SLIDER LE=60 TE=4 WD=150 HT=14 LB='text1' IN=1 LO=-10 HI=10 LV=%-3ld'
- Gadget.2 = 'SLIDER LE=60 TE=22 WD=150 HT=14 LB='text2' IN=1 LO=-10 HI=10 LV=%-3ld'
- Gadget.3 = 'END'
- NewComplexRequest '"Select X & Y Movements!"' Gadget 250 42
- if rc ~= 0 then do
- XOff = 0
- YOff = 0
- end
- else do
- XOff = RESULT.1
- YOff = RESULT.2
- end
- end
-
- if BorderType = 2 then do
- NumA = 1
- NumB = 30
- NumC = 10
- RequestSlider '"Enter Thickness Of Bevel!"' NumA NumB NumC
- Border = Result
- end
-
- Gadget.1 = 'Select Shadow Options!'
- Gadget.2 = 'Use Soft Edge Shadow'
- Gadget.3 = 'Use Regular Shadow'
- Gadget.4 = 'Use No Shadow'
- ListRequest 4 Gadget
- ShadowType = 0
- if result = 2 then ShadowType = 0
- if result = 3 then ShadowType = 1
- if result = 4 then ShadowType = 2
-
- Gadget.1 = 'Select Operator For Background!'
- Gadget.2 = 'Grey Scale'
- Gadget.3 = 'Emboss'
- Gadget.4 = 'Antique'
- Gadget.5 = 'Solarize'
- Gadget.6 = 'Negative'
- Gadget.7 = 'Posterize'
- Gadget.8 = 'False Color'
- Gadget.9 = 'Lighten'
- Gadget.10 = 'Darken'
- Gadget.11 = 'Normal'
- ListRequest 11 Gadget
- Type2 = 0
- if result = 2 then Type2 = 0
- if result = 3 then Type2 = 1
- if result = 4 then Type2 = 2
- if result = 5 then Type2 = 3
- if result = 6 then Type2 = 4
- if result = 7 then Type2 = 5
- if result = 8 then Type2 = 6
- if result = 9 then Type2 = 7
- if result = 10 then Type2 = 8
- if result = 11 then Type2 = 9
-
- Gadget.1 = 'Select Picture Options!'
- Gadget.2 = 'Use Standard Size'
- Gadget.3 = 'User Defined Size'
- ListRequest 3 Gadget
- WindowType = -1
- if result = 2 then WindowType = -1
- if result = 3 then do
- call LoadA()
- call PickBox()
- end
-
- CropAnswer = "None"
- RequestResponse "Does Image Need To Be Cropped?"
- if rc = 0 then do
- if WindowType = -1 then call LoadA()
- call CropPic()
- end
-
- call open TempFile,"VFXIFX:TempDrawer/"strip(Num),W
- call writeln TempFile,PicAName
- call writeln TempFile,Start
- call writeln TempFile,End
- call writeln TempFile,IAType
- call writeln TempFile,Color
- call writeln TempFile,BorderType
- call writeln TempFile,Border
- call writeln TempFile,ShadowType
- call writeln TempFile,Type2
- call writeln TempFile,WindowType
- call writeln TempFile,CropAnswer
- call writeln TempFile,BrushName
- call writeln TempFile,XOff
- call writeln TempFile,YOff
- call close TempFile
- exit
-
-
-
- CropPic:
- Learn "RAM:VFX" NoHeader Quiet Force
- Crop
- Learn Stop Quiet Force
-
- call open TempFile,"RAM:VFX.ifx",R
- do until eof(TempFile)
- line = readln(TempFile)
- parse var line StartLine" "RestOfLine
- if StartLine = "Crop" then CropAnswer = line
- end
- call close TempFile
- address command "Delete >NIL: Ram:VFX.ifx"
-
- return
-
- GetFile:
- parse Arg Title, Path
- Address FLY_1 SetString Path
- Address FLY_1 GetFileNameNT Title
- return result
-
- GetFileName: procedure
- ARG CompleteName
- c = lastpos("/",CompleteName)
- if c = 0 then c = lastpos(":",CompleteName)
- return substr(CompleteName, c + 1)
-
-
- GetA:
- if IAType = 0 then do
- call Switcher(TOSW)
- PicAName = GetFile("Select Flyer Clip For ImageA! ",DriveName)
- Name = GetFileName(PicAName)
- if Name = "" then do
- Address FLY_1 OK_TEXT " OK "
- Title = "You Must Enter A Valid Clip Name To Use!"
- Address FLY_1 FYINT Title
- Address FLY_1 Quit
- call Switcher(TOWB)
- exit
- end
- Address FLY_1 SetFileName PicAName
- Address FLY_1 GetClipLength PicAName
- End = result
- Start = 0
- Address FLY_1 Program "5"
- Address FLY_1 StartNum Start
- Address FLY_1 EndNum End
- Address FLY_1 CurrentNum "0"
- Address FLY_1 GetTimeNT "Select A Range Of Frames To Process!"
- Start = word(result,1)*2
- End = word(result,2)*2
- Start = Start + 1
- End = End +2
- call addlib('PROJECT_REXX_PORT' , 0)
- call addlib(TOASTERLIB,0)
- call Switcher(TOWB)
- address command "C:Wait 1"
- ScreenToFront
- end
- if IAType = 1 then do
- RequestFile '"Select Flyer Still For ImageA!"' DriveName ' '
- PicAName = result
- Name = GetFileName(PicAName)
- if Name = "" then do
- Title = "You Must Enter A Valid Name To Use!"
- RequestNotify Title
- if FlyOn = 1 then Address FLY_1 Quit
- exit
- end
- RequestNumber '"Enter Number Of Frames To Process!"' Frames
- End = result
- Start = 1
- end
- if IAType = 2 then do
- RequestFile '"Select FileName For ImageA!"' 'SYS:' ' '
- PicAName = result
- Name = GetFileName(PicAName)
- if Name = "" then do
- Title = "You Must Enter A Valid Name To Use!"
- RequestNotify Title
- if FlyOn = 1 then Address FLY_1 Quit
- exit
- end
- RequestNumber '"Enter Number Of Frames To Process!"' Frames
- End = result
- Start = 1
- end
- if IAType = 3 then do
- RequestFile '"Select BaseName For ImageA! "' 'SYS:' ' '
- PicAName = result
- Name = GetFileName(PicAName)
- if Name = "" then do
- Title = "You Must Enter A Valid Name To Use!"
- RequestNotify Title
- if FlyOn = 1 then Address FLY_1 Quit
- exit
- end
- RequestNumber '"Enter Number Of Frames To Process!"' Frames
- End = result
- Start = 1
- end
- return
-
- CloseStuff:
- Address FLY_1 Quit
- call remlib('ToasterARexx.port')
- call remlib('PROJECT_REXX_PORT')
- return
-
-
- OpenFlyStuff:
- FlyOn = 1
- address command "run VFXIFX:FLY"
- do while (POS('FLY_1',SHOW('Ports')) = 0)
- address command "wait 1"
- end
- TOASTERLIB="ToasterARexx.port"
- call remlib('ToasterARexx.port')
- call remlib('PROJECT_REXX_PORT')
- call addlib('PROJECT_REXX_PORT' , 0)
- call addlib(TOASTERLIB,0)
- DriveName = FindDrive()
- return
-
-
- FindDrive:
- address command "C:Info >RAM:DriveList"
- call open TempFile,"RAM:DriveList",R
- do until eof(TempFile)
- line = readln(TempFile)
- parse var line Drive" "Rest
- if Drive = "FA0:" then
- FlyVolume = word(Rest,7)":"
- end
- call close TempFile
- address command "Delete >NIL: RAM:DriveList"
- return FlyVolume
-
-
-
- LoadA:
- if IAType = 0 then do
- LoadBuffer PicAName Force Start
- end
- if IAType = 1 then do
- LoadBuffer PicAName Force 1
- end
- if IAType = 2 then do
- LoadBuffer PicAName Force
- end
- if IAType = 3 then do
- LoadBuffer PicAName""right(Start,3,'0') Force
- end
- return
-
- PickBox:
- KillBrush
- GetMain
- parse var result Name Width Height Blah
- if Width = 0 || Height = 0 then do
- WindowType = -1
- return
- end
- Menu ToolBox
- RequestNotify "Draw Rectangle Where You Want New Image Placed!"
- DrawTool Box
- HidePanel
- Undo On
- WaitFor SELECTDOWN
- parse var result X1 Y1
- WaitFor SELECTUP
- parse var result X2 Y2
- Undo
- ShowPanel
- Undo Off
- X1 = strip(X1)
- Y1 = strip(Y1)
- X2 = strip(X2)-X1
- Y2 = strip(Y2)-Y1
- RequestResponse "Is The Box You Selected Correct?"
- if rc ~= 0 then call PickBox()
-
- WindowType = X1" "Y1" "X2" "Y2
-
- return
-
-
-
-
- Docs:
-
- text1 = '"This effect takes an image and places a copy of itself"'
- text2 = '"in the middle of the screen. You can change the way the"'
- text3 = '"background image looks and add a border to the center"'
- text4 = '"image."'
- text5 = '" "'
- text6 = '"The Crop Image option is there for Flyer Users. The clip"'
- text7 = '"may have garbage on the edges, that are not seen because"'
- text8 = '"of overscan but when scaled to the center, you can see it."'
- text9 = '"This allows you to crop the garbage first, then it will"'
- text10 = '"scale it back to the correct size."'
-
- Gadget.1 = 'TEXT LE=10 TE=4 LB='text1' '
- Gadget.2 = 'TEXT LE=10 TE=14 LB='text2' '
- Gadget.3 = 'TEXT LE=10 TE=24 LB='text3' '
- Gadget.4 = 'TEXT LE=10 TE=34 LB='text4' '
- Gadget.5 = 'TEXT LE=10 TE=44 LB='text5' '
- Gadget.6 = 'TEXT LE=10 TE=54 LB='text6' '
- Gadget.7 = 'TEXT LE=10 TE=64 LB='text7' '
- Gadget.8 = 'TEXT LE=10 TE=74 LB='text8' '
- Gadget.9 = 'TEXT LE=10 TE=84 LB='text9' '
- Gadget.10 = 'TEXT LE=10 TE=94 LB='text10' '
- Gadget.11 = 'END'
- NewComplexRequest '"Instructions For Effect #02"' Gadget 420 106
-
- return
-
-
-