{Presentation Macros, sample file, July 96} {uses a slightly modified NIH-Image, v 1.58, called Presentation-Image} {Keep this or a similar file named "Image Macros" in the same folder as the} {application file "Presentation-Image"} {IMPORTANT: Presentation Image is buggy software. Use it only to display images,} {NOT for analyzing or processing them. Some functions might not work all the time,} {including the Save command. With this caveat in mind, most functions do work and} {menus can still be accessed normally, even if the menu bar is covered by the image.} {For further information, read the ReadMe file that is part of this distribution} {NIH-Image and modifications for Presentation-Image are in the public domain} {Source code modifications for Presentation-Image and this sample macro file by} {Rudolf Oldenbourg, Marine Biological Laboratory, Woods Hole, MA, USA} {e-mail: rudolfo@mbl.edu} {usage of rUser1[] array:} {rUser1[1] current gamma contrast value} {rUser1[10] x coordinate of top left corner, used for open image window} {rUser1[11] y coordinate of top left corner, used for open image window} {rUser1[12] flag, 0 -> show image only, overide menu bar} { not 0 -> show menu bar} procedure SetContrast(gamma:real); {This procedure is used to set an exponential LUT with exponent gamma} var i,v:integer; min,max:integer begin rUser1[1]:=gamma; min:=0; max:=255; for i:=1 to 254 DO begin if (i>min) and (i0 do begin Dispose; end; {Close any open window first} rUser1[10] := 0; rUser1[11] := 0; rUser1[12] := 0; Open('PowerBook:Images:Background'); {Enter full path and file name} rUser1[10] := 0; rUser1[11] := 0; rUser1[12] := 0; Open('PowerBook:Images:Introduction'); {Enter full path and file name} end macro 'YourImage [F2]' {Regular call to load an image} begin while nPics>1 do begin Dispose; end; {Close all open windows, except background} UserCode('ShowImage', 0, 0, 0); SelectPic(1); {makes background cover menu bar} rUser1[10] := 0; rUser1[11] := 0; {use to center image on screen} rUser1[12] := 0; {just in case} Open('PowerBook:Images:YourImage); {enter complete path to avoid open dialog box} end macro '-' {menu divider} macro 'Background [b]' {loads background image. First create image with the texture and color you wish; image size equal to monitor size} begin while nPics<>0 do begin Dispose; end; rUser1[10] := 0; rUser1[11] := 0; rUser1[12] := 0; Open('PowerBook:Images:Background'); end macro 'Show Image [s]' {In some circumstances this is required to cover menubar} begin UserCode('ShowImage', 0, 0, 0); end macro 'Restore Screen [r]' begin UserCode('RestoreScreen', 0, 0, 0); end macro 'Move Image [m]' begin MoveWindow(rUser1[10],rUser1[11]); end macro '0,0 window position [o]' begin rUser1[10] := 0; rUser1[11] := 0; rUser1[12] := 0; end macro '84,40 window position [p]' begin rUser1[10] := 84; rUser1[11] := 40; rUser1[12] := 1; end macro 'Set standard Contrast [j]'; begin rUser1[1] := 1; SetContrast(rUser1[1]); end; macro 'Increase Contrast [l]'; begin if rUser1[1] = 0 then rUser1[1] := 1; rUser1[1]:=rUser1[1] + 0.2; if rUser1[1]>3 then rUser1[1]:=3; SetContrast(rUser1[1]); end; macro 'Decrease Contrast [k]'; begin if rUser1[1] = 0 then rUser1[1] := 1; rUser1[1]:=rUser1[1] - 0.2; if rUser1[1]<0.2 then rUser1[1]:=0.2; SetContrast(rUser1[1]); end;