unit1.pas 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. // SPDX-License-Identifier: GPL-3.0-only
  2. unit Unit1;
  3. {$mode objfpc}{$H+}
  4. interface
  5. uses
  6. Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
  7. ExtCtrls;
  8. type
  9. { TForm1 }
  10. TForm1 = class(TForm)
  11. Button1: TButton;
  12. Button2: TButton;
  13. Image1: TImage;
  14. procedure Button1Click(Sender: TObject);
  15. procedure Button2Click(Sender: TObject);
  16. procedure FormCreate(Sender: TObject);
  17. private
  18. { private declarations }
  19. public
  20. { public declarations }
  21. end;
  22. var
  23. Form1: TForm1;
  24. implementation
  25. uses LazpaintInstance;
  26. {$R *.lfm}
  27. { TForm1 }
  28. procedure TForm1.Button1Click(Sender: TObject);
  29. var lazpaint: TLazPaintInstance;
  30. begin
  31. lazpaint := TLazPaintInstance.Create;
  32. //lazpaint.AboutText:= 'This is the normal application';
  33. lazpaint.Run;
  34. lazpaint.Free;
  35. end;
  36. procedure TForm1.Button2Click(Sender: TObject);
  37. var lazpaint: TLazPaintInstance;
  38. bmp: TBitmap;
  39. begin
  40. lazpaint := TLazPaintInstance.Create(True);
  41. //lazpaint.AboutText:= 'This is an embedded application';
  42. lazpaint.Run;
  43. if lazpaint.EmbeddedResult = mrOK then
  44. begin
  45. bmp := lazpaint.Image.MakeBitmapCopy(ColorToRGB(clBtnFace));
  46. image1.Picture.assign(bmp);
  47. bmp.Free;
  48. end;
  49. lazpaint.Free;
  50. end;
  51. procedure TForm1.FormCreate(Sender: TObject);
  52. begin
  53. end;
  54. end.