home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 2: PC / frozenfish_august_1995.bin / bbs / d09xx / d0925.lha / DonsGenies / FrenchGenies.lha / Rexx / AjusteBitmapAuxBoîtes.pprx < prev    next >
Text File  |  1993-08-03  |  2KB  |  64 lines

  1. /*
  2. @BAjusteBitmapAuxBoεtes @P @I Ecrit et ⌐ par Don Cox juillet 1992
  3. @IN'est pas du Domaine Publique. Tous Droits RΘservΘs.
  4. Traduit par Fabien Larini le 23/07/93.
  5.  
  6. Ajuste la taille de l'image afin qu'elle remplisse la boεte, en
  7. prΘsumant d'une rΘsolution Θcran de 75 dpi. Ce GΘnie peut s'occuper
  8. de une ou plusieurs boεtes.
  9. */
  10.  
  11. /*FitBitmapToBoxes*/
  12. /* Fit image exactly into box, distorting as needed, assuming a screen resolution of 75 dpi in hi-res.
  13. Written by Don Cox  July '92  */
  14.  
  15.  
  16. signal on error
  17. signal on syntax
  18.  
  19. address command
  20. call ppm_AutoUpdate(0)
  21. call SafeEndEdit.rexx()
  22. oldunits = ppm_GetUnits()
  23. call ppm_SetUnits(1)
  24.  
  25. do forever
  26.     box = ppm_ClickOnBox("Clickez dans la Boεte contenant l'Image")
  27.  
  28.     if box=0 then break
  29.     boxtype = upper(word(ppm_GetBoxInfo(box), 1))
  30.     if boxtype~="BITMAP" then do
  31.         call ppm_Inform(1,"Cette Boεte ne contient pas d'Image Bitmap",)
  32.         call ppm_ClearStatus()
  33.         exit
  34.         end
  35.  
  36.     size = ppm_GetBoxSize(box)
  37.     boxwidth = word(size,1)
  38.     boxheight = word(size,2)
  39.     margins = ppm_GetBoxMargins(box)
  40.     parse var margins mleft mtop mright mbottom
  41.     boxwidth = boxwidth-mleft-mright
  42.     boxheight = boxheight-mtop-mbottom
  43.  
  44.  
  45.     info = ppm_GetBoxInfo(box)
  46.     width = word(info,2)
  47.     height = word(info,3)
  48.  
  49.     width = width/75  /* screen images at 75dpi for high res */
  50.     xscale = boxwidth/width
  51.     height = height/75
  52.     yscale = boxheight/height
  53.  
  54.  
  55.     call ppm_SetBoxScale(box,xscale,yscale)
  56.     call ppm_SetBoxOffset(box,0,0)
  57.     end
  58.  
  59. call ppm_SetUnits(oldunits)
  60. call ppm_ClearStatus()
  61. call ppm_AutoUpdate(1)
  62.  
  63. exit
  64.