;*** ZFE's PicView;*** Version 1.0 07/06/96;*** Coded by Richard Whittall;*** EMail rich@xtreme.demon.co.uk;Please read the limitations text at the bottom of this code, if;anyone can sort them out can they EMail me;----------------------------------------------------;; Any of this source code can be distributed freely, ;; on condition that full credit is given to ;; Richard Whittall (ZFE) ;;----------------------------------------------------;€Ăvers$="$VER: ZFEs PicView 1.0 (07/06/96)"Ï 0; Set-Up constants (for GT gadgets)#cabout = 0#cload = 1#cquit = 3#text = 4#cok = 5#cview = 6; Set-up default window valuesx=20y=20w=224h=144; Set-up variablessts = § el=0txt=0ld=0stat=0ax=10ay=10aw=300ah=230€2 pa$=192€2 fi$=192€ abt$(10); About window text (stored in the abt$ array)abt$(0) = " ZFE's PicView 1.0"abt$(1) = ""abt$(2) = " Coded by:"abt$(3) = " Richard Whittall"abt$(4) = ""abt$(5) = " E-Mail:"abt$(6) = "rich@xtreme.demon.co.uk"abt$(7) = ""abt$(8) = " Copyright (C)1996"; custom ERROR checking; if the file being loaded isn't IFF, loading will abort; any other error - exits (after requester).error€Ž€ ld=1 el=0 Ï 0 Ɣ 0,#text," [ Load Error ] " pa$="" fi$="" ld=0€ loop€"err.l=ą("Warning","Fatal Error","Exit!") €€À€ €Ž.strt€ § <0 €; Set-up MenusÄ 0,0,"Project"Ä 0,0,0,0,"About a"Ä 0,0,0,1,"Load l"Ä 0,0,0,2,"QUIT","q"Ä 0,1,"Operators"Ä 0,0,1,0,"View v"; Set-up GadTool gadgetsƂ 0,#cabout,0,4,68,16,"_About",$10Ƃ 0,#cload,0,45,68,16,"_Load",S10Ƃ 0,#cview,0,62,68,16,"_View",$10Ƃ 0,#cquit,0,104,68,16,"QUIT",$10ƍ 0,#text,72,104,140,16,"",$10,""; Set-up and open windowĆ$2|$4|$8|$10|$20|$40|$100|$200|$400|$40000|$80000|$400000Ă 0,"topaz.font",8Ć 0,x,y,w,h,$0002|$0004|$0008|$0080|$1000,"ZFE's PicView",1,2Ć8Ć 0Ǝ 0,0Ć 0Ć 1,0Ć 81,12ʁ "Width:"Ć 81,25ʁ "Height:"Ć 81,38ʁ "Colours:"Ć 81,51ʁ "ViewMode:"Ć 2,0Ć 80,11ʁ "Width:"Ć 80,24ʁ "Height:"Ć 80,37ʁ "Colours:"Ć 80,50ʁ "ViewMode:"Ä 0; Main program loop - incoroprating Events and flicking credits.loopĆ 0€, Ć 0€» € § <0 € ev.l = Ć curs = § € ev = $100 €B Ć=0 €! € lab1 € ev = $100 €B Ć=1 €! € lab2 € ev = $40 €! € lab3 € ev = $400 €B ĆA=-32764 € lab4 € ev = $400 €B ĆA=-32766 € lab4 € ev = $400 €B ĆA=-32767 € lab4 € ev = $400 €B ĆA=-32768 € lab4 € ev = $200 € bye € Œ (sts-curs)>1 sts = § el=el+1 €À € el=2 €B txt=0 el=0 Ɣ 0,#text," Select Option" txt=1 €À € el=2 €B txt=1 el=0 Ɣ 0,#text," Waiting..." txt=0 €À€Ç; Menu item select events.lab1€ Ć=0 € about€À€ Ć=1 € load€À€ Ć=2 € bye€À.lab2€ Ć=0 € view€À; Gadtools button select events.lab3€ Ć=#cquit € bye€À € Ć=#cabout € about€À€ Ć=#cload € load€À€ Ć=#cview € view€À€; Keypress events.lab4€ Ć@=69 € bye€À€ Ć@=40 € load€À€ Ć@=32 € about€À€ Ć@=52 € view€À€.aboutx=Ć y=Ć!Ɣ 0,#text," [ About: ] "Ƃ 1,#cok,59,76,68,16,"_Ok",$10Ć 2,x+15,y+15,w-30,h-30,$1000,"",1,2€, Ć 2Ć 0Ć 0Ǝ 1,2Ć 1,0Ć 1,6€ n=0 € 8 txt$=abt$(n) ʂ txt$€Ć 2,0Ć 0,5€ n=0 € 8 txt$=abt$(n) ʂ txt$€€» ev.l = Ć € ev=$40 €! € out € ev=$400 €! € keys€Çkeys€ Ć@=24 € out€À€ Ć@=68 € out€À€out€+ Ć 2€+ Ɓ 1Ɣ 0,#text," Waiting... "el=0txt=0€ loop.view€ stat=0 € msgƔ 0,#text," Viewing... "Ï 1,0,0,vw,vh,id,vm,"",0,1Ć 1,0,0,vw,vh,$0800|$1000,"",0,1€, Î 0Ï 1,pic$,0€, Ć 1€ €+ Ć 1€+ Ï 1Ï 0Ɣ 0,#text," Waiting... "el=0txt=0€ loop; load a shapes file (from an IFF - including palette data).loadƔ 0,#text," Loading..."ld=1f$=š("Select IFF File",pa$,fi$,"",ax,ay,aw,ah)€ ܏(f$)>0 pic$=f$ Є pic$ iw=Ѕ ih=І id=Ї; set-up auto detecting viewmodes for the view screen(1) € Ј=32768 €! vm=$8000:vw=640:vh=256 ; hi-res € Ј=2048 €! vm=$200:vw=320:vh=256 ; ham € Ј=4 €! vm=4:vw=320:vh=512 ; interlace € Ј=0 €! vm=0:vw=320:vh=256 ; lo-res € Ј=32772 €! vm=$8004:vw=640:vh=512 ; hi-res interlace € Ј=34816 €! vm=$8200:vw=640:vh=256 ; hi-res ham € Ј=2052 €! vm=$204:vw=320:vh=512 ; interlace ham € Ј=34820 €! vm=$8204:vw=640:vh=512 ; hi-res interlace ham stat=1 € id=1 €! cs=2 € id=2 €! cs=4 € id=3 €! cs=8 € id=4 €! cs=16 € id=5 €! cs=32 € id=6 €! cs=64 € id=7 €! cs=128 € id=8 €! cs=256 Î 0,pic$€À; Print the results of the ILBMInfo commands onto the window; when a new picture is loadedĆ 1€, Ć 0Ć 156,11ʁ " "Ć 156,24ʁ " "Ć 156,37ʁ " "Ć 156,50ʁ " "Ć 156,11ʁ iwĆ 156,24ʁ ihĆ 156,37ʁ csĆ 156,50ʁ Јld=0Ɣ 0,#text," Waiting... "el=0txt=0€ loop; message to display if you try to view an image; if one isn't loaded.msgoops.l = ą("Error","No picture loaded","Ooops!")€ loop; QUIT section - with quit requester.byeexit.l=ą("Request","Quit PicView?","Yes|No")€ exit=0 €! € loopƔ 0,#text," Quit - Bye"€;*** Program History; # 1.00 - First finished version, ready for BUM 10; Not exactly ADPro, but it shows off some useful; intuition routines, such as multiple windows, text; printing effects, requestors, IFF viewing, auto-detect; screen-modes (reading info from IFF files) - ILBMInfo;*** Limitations:;1. No option to view images larger than 640x512;2. The auto-detect HAM modes doesn't seem to work, despite; what the Blitz manual says, ILBMViewMode does not return; 2048 for a HAM image, it seems to ignore the HAM data; altogether!