Main.pas 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. unit Main;
  2. {$include GR32.inc}
  3. interface
  4. uses
  5. Forms, Classes, Controls,
  6. GR32,
  7. GR32_Image;
  8. type
  9. TFormMain = class(TForm)
  10. ImgView: TImgView32;
  11. procedure FormCreate(Sender: TObject);
  12. private
  13. protected
  14. public
  15. end;
  16. var
  17. FormMain: TFormMain;
  18. implementation
  19. {$R *.dfm}
  20. uses
  21. Graphics,
  22. GR32.Examples,
  23. GR32.ImageFormats.PNG32;
  24. { TFormMain }
  25. {.$define SOLID_DROPSHADOW}
  26. procedure TFormMain.FormCreate(Sender: TObject);
  27. begin
  28. ImgView.Bitmap.LoadFromFile(Graphics32Examples.MediaFolder+'\coffee.png');
  29. ImgView.Background.CheckersStyle := bcsMedium;
  30. ImgView.Background.CheckersExponent := 3; // Size of each tile becomes 2^3 = 8 pixels
  31. ImgView.Background.PatternBitmap.LoadFromFile(Graphics32Examples.MediaFolder+'\bumps.bmp');
  32. ImgView.Background.OuterBorderColor := clGray;
  33. ImgView.Background.InnerBorderWidth := 8;
  34. ImgView.Background.InnerBorderColor := clWhite;
  35. ImgView.Background.DropShadowOffset := 6;
  36. {$ifdef SOLID_DROPSHADOW}
  37. ImgView.Background.DropShadowSize := 4;
  38. ImgView.Background.DropShadowColor := $20000000;
  39. {$else SOLID_DROPSHADOW}
  40. ImgView.Background.DropShadowBitmap.LoadFromFile(Graphics32Examples.MediaFolder+'\dropshadow.bmp');
  41. ImgView.Background.DropShadowBitmap.MasterAlpha := 128;
  42. {$endif SOLID_DROPSHADOW}
  43. end;
  44. end.