home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / mac / hypercar / xfcn / maskimag.cpt / MaskImage / cards.xml < prev    next >
Encoding:
Text File  |  1991-12-26  |  6.3 KB  |  141 lines

  1. card_3057.xml
  2. <?xml version="1.0" encoding="utf-8" ?>
  3. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  4. <card>
  5.     <id>3057</id>
  6.     <filler1>0</filler1>
  7.     <cantDelete> <false /> </cantDelete>
  8.     <showPict> <true /> </showPict>
  9.     <dontSearch> <false /> </dontSearch>
  10.     <owner>2747</owner>
  11.     <link rel="stylesheet" type="text/css" href="stylesheet_3118.css" />
  12.     <part>
  13.         <id>1</id>
  14.         <type>button</type>
  15.         <visible> <true /> </visible>
  16.         <reserved5> 0 </reserved5>
  17.         <reserved4> 0 </reserved4>
  18.         <reserved3> 0 </reserved3>
  19.         <reserved2> 0 </reserved2>
  20.         <reserved1> 0 </reserved1>
  21.         <enabled> <true /> </enabled>
  22.         <rect>
  23.             <left>18</left>
  24.             <top>14</top>
  25.             <right>212</right>
  26.             <bottom>47</bottom>
  27.         </rect>
  28.         <style>roundrect</style>
  29.         <showName> <true /> </showName>
  30.         <highlight> <false /> </highlight>
  31.         <autoHighlight> <false /> </autoHighlight>
  32.         <sharedHighlight> <true /> </sharedHighlight>
  33.         <family>0</family>
  34.         <titleWidth>0</titleWidth>
  35.         <icon>0</icon>
  36.         <textAlign>center</textAlign>
  37.         <font>Chicago</font>
  38.         <textSize>12</textSize>
  39.         <textStyle>plain</textStyle>
  40.         <name>Paste Foreground Picture</name>
  41.         <script>On MouseUp
  42. Set hilite of the target to true
  43. DoPastePicture "ForegroundPicture"
  44. Set hilite of the target to false
  45. End MouseUp</script>
  46.     </part>
  47.     <part>
  48.         <id>2</id>
  49.         <type>button</type>
  50.         <visible> <true /> </visible>
  51.         <reserved5> 0 </reserved5>
  52.         <reserved4> 0 </reserved4>
  53.         <reserved3> 0 </reserved3>
  54.         <reserved2> 0 </reserved2>
  55.         <reserved1> 0 </reserved1>
  56.         <enabled> <true /> </enabled>
  57.         <rect>
  58.             <left>18</left>
  59.             <top>64</top>
  60.             <right>212</right>
  61.             <bottom>97</bottom>
  62.         </rect>
  63.         <style>roundrect</style>
  64.         <showName> <true /> </showName>
  65.         <highlight> <false /> </highlight>
  66.         <autoHighlight> <false /> </autoHighlight>
  67.         <sharedHighlight> <true /> </sharedHighlight>
  68.         <family>0</family>
  69.         <titleWidth>0</titleWidth>
  70.         <icon>0</icon>
  71.         <textAlign>center</textAlign>
  72.         <font>Chicago</font>
  73.         <textSize>12</textSize>
  74.         <textStyle>plain</textStyle>
  75.         <name>Paste Background Picture</name>
  76.         <script>On MouseUp
  77. Set hilite of the target to true
  78. DoPastePicture "BackgroundPicture"
  79. Set hilite of the target to false
  80. End MouseUp</script>
  81.     </part>
  82.     <part>
  83.         <id>3</id>
  84.         <type>button</type>
  85.         <visible> <true /> </visible>
  86.         <reserved5> 0 </reserved5>
  87.         <reserved4> 0 </reserved4>
  88.         <reserved3> 0 </reserved3>
  89.         <reserved2> 0 </reserved2>
  90.         <reserved1> 0 </reserved1>
  91.         <enabled> <true /> </enabled>
  92.         <rect>
  93.             <left>18</left>
  94.             <top>114</top>
  95.             <right>212</right>
  96.             <bottom>146</bottom>
  97.         </rect>
  98.         <style>roundrect</style>
  99.         <showName> <true /> </showName>
  100.         <highlight> <false /> </highlight>
  101.         <autoHighlight> <false /> </autoHighlight>
  102.         <sharedHighlight> <true /> </sharedHighlight>
  103.         <family>0</family>
  104.         <titleWidth>0</titleWidth>
  105.         <icon>0</icon>
  106.         <textAlign>center</textAlign>
  107.         <font>Chicago</font>
  108.         <textSize>12</textSize>
  109.         <textStyle>plain</textStyle>
  110.         <name>Paste Mask Picture</name>
  111.         <script>On MouseUp
  112. Set hilite of the target to true
  113. DoPastePicture "MaskPicture"
  114. Set hilite of the target to false
  115. End MouseUp</script>
  116.     </part>
  117.     <part>
  118.         <id>4</id>
  119.         <type>button</type>
  120.         <visible> <true /> </visible>
  121.         <reserved5> 0 </reserved5>
  122.         <reserved4> 0 </reserved4>
  123.         <reserved3> 0 </reserved3>
  124.         <reserved2> 0 </reserved2>
  125.         <reserved1> 0 </reserved1>
  126.         <enabled> <true /> </enabled>
  127.         <rect>
  128.             <left>236</left>
  129.             <top>52</top>
  130.             <right>359</right>
  131.             <bottom>109</bottom>
  132.         </rect>
  133.         <style>roundrect</style>
  134.         <showName> <true /> </showName>
  135.         <highlight> <false /> </highlight>
  136.         <autoHighlight> <false /> </autoHighlight>
  137.         <sharedHighlight> <true /> </sharedHighlight>
  138.         <family>0</family>
  139.         <titleWidth>0</titleWidth>
  140.         <icon>0</icon>
  141.         <textAlign>center</textAlign>
  142.         <font>Chicago</font>
  143.         <textSize>12</textSize>
  144.         <textStyle>plain</textStyle>
  145.         <name>Generate Result</name>
  146.         <script>On DoMaskImage
  147. Global ForegroundPicture, BackgroundPicture, MaskPicture
  148. If ForegroundPicture is empty then
  149. Answer "You need to specify a foreground picture."
  150. Exit DoMaskImage
  151. End If
  152. If BackgroundPicture is empty then
  153. Answer "You need to specify a background picture."
  154. Exit DoMaskImage
  155. End If
  156. If MaskPicture is empty then
  157. Answer "You need to specify a mask picture."
  158. Exit DoMaskImage
  159. End If
  160. Get MaskImage(ForegroundPicture, BackgroundPicture, MaskPicture)
  161. If it < 0 then
  162. Answer "Error" && it && "generating result."
  163. Exit DoMaskImage
  164. End If
  165. PictureToScrap it
  166. KillPicture it
  167. End DoMaskImage
  168.  
  169. On MouseUp
  170. Set hilite of the target to true
  171. DoMaskImage
  172. Set hilite of the target to false
  173. End MouseUp
  174. </script>
  175.     </part>
  176.     <name></name>
  177.     <script>On DoPastePicture PictureVarName
  178. Do "Global" && PictureVarName
  179. Get PictureFromScrap()
  180. If it < 0 then
  181. If it = -102 then
  182. Answer "There is no picture on the Clipboard."
  183. Else If it = -108 then
  184. Answer "Not enough memory to paste the picture."
  185. Else
  186. Answer "Error" && it && "getting picture from Clipboard."
  187. End If
  188. Exit DoPastePicture
  189. End If
  190. Put it into NewPicture
  191. If the value of PictureVarName is not empty then
  192. Answer "There is already a" && PictureVarName & "." & return & ┬¼
  193. "Get rid of it?" with "Cancel" or "OK"
  194. If it is "Cancel" then
  195. Exit DoPastePicture
  196. End If
  197. KillPicture the value of PictureVarName
  198. Do "Put empty into" && PictureVarName
  199. End If
  200. Do "Put" && NewPicture && "into" && PictureVarName
  201. End DoPastePicture
  202.  
  203. On GenerateRamp
  204. Ask "From color?" with "0,0,0"
  205. Put it into FromColor
  206. Ask "To color?" with "65535,65535,65535"
  207. Put it into ToColor
  208. Ask "Bounds?" with "0,0,256,256"
  209. Put it into RampBounds
  210. Answer "Ramp direction?" with "Horizontal" or "Vertical"
  211. Put it is "Horizontal" into HorizRamp
  212. Get Ramp(FromColor, ToColor, RampBounds, HorizRamp)
  213. If it < 0 then
  214. Answer "Error" && it && "generating ramp"
  215. Exit GenerateRamp
  216. End If
  217. PictureToScrap it
  218. KillPicture it
  219. End GenerateRamp
  220.  
  221. On OpenCard
  222. Global ForegroundPicture, BackgroundPicture, MaskPicture
  223. Put empty into ForegroundPicture
  224. Put empty into BackgroundPicture
  225. Put empty into MaskPicture
  226. End OpenCard
  227.  
  228. On CloseCard
  229. Global ForegroundPicture, BackgroundPicture, MaskPicture
  230. If ForegroundPicture is not empty then
  231. KillPicture ForegroundPicture
  232. Put empty into ForegroundPicture
  233. End If
  234. If BackgroundPicture is not empty then
  235. KillPicture BackgroundPicture
  236. Put empty into BackgroundPicture
  237. End If
  238. If MaskPicture is not empty then
  239. KillPicture MaskPicture
  240. Put empty into MaskPicture
  241. End If
  242. End CloseCard
  243. </script>
  244. </card>
  245.  
  246.  
  247.