unit1.pas 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. unit Unit1;
  2. {$mode objfpc}{$H+}
  3. interface
  4. uses
  5. Forms, Graphics,
  6. BCImageButton, BGRABitmap,
  7. BCFilters, BCButton, Classes;
  8. type
  9. { TForm1 }
  10. TForm1 = class(TForm)
  11. BCImageButton1: TBCImageButton;
  12. BCImageButton2: TBCImageButton;
  13. BCImageButton3: TBCImageButton;
  14. BCImageButton4: TBCImageButton;
  15. BCImageButton5: TBCImageButton;
  16. BCImageButton6: TBCImageButton;
  17. procedure BCImageButton1Click(Sender: TObject);
  18. procedure FormCreate(Sender: TObject);
  19. private
  20. { private declarations }
  21. public
  22. { public declarations }
  23. end;
  24. var
  25. Form1: TForm1;
  26. implementation
  27. {$R *.lfm}
  28. { TForm1 }
  29. procedure TForm1.FormCreate(Sender: TObject);
  30. begin
  31. BCImageButton1.BitmapFile := Application.Location + BCImageButton1.BitmapFile;
  32. BCImageButton2.BitmapFile := Application.Location + BCImageButton2.BitmapFile;
  33. BCImageButton3.BitmapFile := Application.Location + BCImageButton3.BitmapFile;
  34. BCImageButton4.BitmapFile := Application.Location + BCImageButton4.BitmapFile;
  35. BCImageButton5.BitmapFile := Application.Location + BCImageButton5.BitmapFile;
  36. BCImageButton6.BitmapFile := Application.Location + BCImageButton6.BitmapFile;
  37. BCImageButton1.LoadFromBitmapFile;
  38. BCImageButton2.LoadFromBitmapFile;
  39. BCImageButton2.TextVisible := False;
  40. BCImageButton3.LoadFromBitmapFile;
  41. BCImageButton4.LoadFromBitmapFile;
  42. BCImageButton5.LoadFromBitmapFile;
  43. GrayScale(BCImageButton1.BitmapOptions.Bitmap);
  44. BCImageButton5.SaveToFile('button.bcimagebutton');
  45. BCImageButton6.AssignFromFile('button.bcimagebutton');
  46. end;
  47. procedure TForm1.BCImageButton1Click(Sender: TObject);
  48. begin
  49. BCImageButton1.Assign(BCImageButton2);
  50. end;
  51. end.