SAMPLE05.MOD 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. (******************************************************************************)
  2. (* SAMPLE05.MOD *)
  3. (* *)
  4. (* ZoomBits Example *)
  5. (* Taken from SAMPLE05.PAS - Metagraphics Software Corporation (c) 1987-1989 *)
  6. (* *)
  7. (* PSW 10/31/90 09:25pm *)
  8. (******************************************************************************)
  9. MODULE Sample05;
  10. (*
  11. * Graphix
  12. * Release 3.7
  13. * (c) Copyright 1986-1992 PMI
  14. * Green Bay, Wisconsin
  15. * (414) 468-6040
  16. * All rights reserved
  17. *
  18. *)
  19. IMPORT GrQry;
  20. IMPORT GrConst;
  21. IMPORT GrPorts;
  22. IMPORT Meta;
  23. IMPORT IO;
  24. VAR
  25. GrafixCard,
  26. CommPort: INTEGER;
  27. i, j: INTEGER;
  28. ch: CHAR;
  29. thePort: GrPorts.adsPort; (* pointer to default port *)
  30. theBitmap: GrPorts.adsBMap; (* pointer to default bitmap *)
  31. scrnR, dstR,
  32. srcR: GrConst.rect;
  33. BEGIN
  34. (* init the system *)
  35. GrQry.GrInit(GrafixCard, CommPort);
  36. i := Meta.InitGrafix(-GrafixCard);
  37. IF (i # 0) THEN
  38. (* Display reason for no go *)
  39. GrQry.GrInitErr(GrafixCard, CommPort, i);
  40. END;
  41. Meta.ScreenRect(scrnR);
  42. Meta.SetDisplay(GrConst.GrafPg0);
  43. Meta.EraseRect(scrnR);
  44. Meta.GetPort(thePort); (* Get default port address *)
  45. theBitmap := thePort^.portBMap; (* Get default bmap address *)
  46. Meta.MoveTo(50, 50);
  47. Meta.DrawString('ZoomBits');
  48. Meta.SetRect(srcR, 45, 40, 115, 55);
  49. Meta.FrameRect(srcR);
  50. Meta.SetRect(dstR, 50, 100, 595, 195);
  51. Meta.FrameRect(dstR);
  52. Meta.ZoomBits(theBitmap, theBitmap, srcR, dstR, dstR, 0);
  53. Meta.MoveTo(10, 20);
  54. Meta.DrawString('press return to terminate');
  55. ch := IO.RdChar();
  56. GrQry.GrQuit('', 0);
  57. END Sample05.