view.pp 934 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. {$MODE objfpc}
  2. Uses
  3. SysUtils, ptc;
  4. Var
  5. console : TPTCConsole;
  6. surface : TPTCSurface;
  7. format : TPTCFormat;
  8. pixels : Pint32;
  9. width, height : Integer;
  10. I : Integer;
  11. F : File;
  12. Begin
  13. Try
  14. console := TPTCConsole.Create;
  15. format := TPTCFormat.Create(24, $00FF0000, $0000FF00, $000000FF);
  16. surface := TPTCSurface.Create(320, 200, format);
  17. console.open('Random example', surface.width, surface.height, format);
  18. format.Free;
  19. For I := 1 To 100 Do
  20. Begin
  21. Writeln('test', I, '.raw');
  22. ASSign(F, 'test' + IntToStr(I) + '.raw');
  23. Reset(F, 1);
  24. BlockRead(F, surface.lock^, surface.height * surface.pitch);
  25. surface.unlock;
  26. Close(F);
  27. surface.copy(console);
  28. console.update;
  29. console.read.Free;
  30. End;
  31. console.close;
  32. console.Free;
  33. surface.Free;
  34. Except
  35. On error : TPTCError Do
  36. { report error }
  37. error.report;
  38. End;
  39. End.