tb0164.pp 660 B

123456789101112131415161718192021222324252627282930313233
  1. { %GRAPH }
  2. { %TARGET=go32v2,win32,linux }
  3. { Old file: tbs0195.pp }
  4. { Problem with Getimage, crash of DOS box, even with dpmiexcp!! (PFV) Not a bugs, you must use p^. }
  5. uses graph;
  6. var
  7. GDriver, GMode: Integer;
  8. w:word;
  9. p:pointer;
  10. begin
  11. GDriver := $FF;
  12. GMode := $101;
  13. InitGraph(GDriver, GMode, '');
  14. if (GraphResult <> grOK) then
  15. Halt(0);
  16. rectangle(0,0,getmaxx,getmaxy);
  17. w := imagesize(0,0,111,111);
  18. getmem(p, w);
  19. {---runtime-error!------}
  20. { getimage(0,0,111,111, p); }
  21. {-----------------------}
  22. { This is the correct usage (PFV) }
  23. getimage(0,0,111,111, p^);
  24. freemem(p, w);
  25. closegraph;
  26. readln;
  27. end.