Demo: Cross Codebot
The following is a quick demo of the soon to be released Cross Codebot Lazarus class library. The main features of Cross Codebot is a new cross platform hardware accelerated graphics interface. This interface also includes a new theme engine and a whole set of new and revived controls. A short progress report was issued here.
Below is a very brief demo run on an 8 year old laptop. The quality suffers a bit due to the capture program I used, but when the video capture is off the demo runs smooth as silk, rotating, stretching, and colorizing images with no lag whatsoever.
Demo Source Code
Here is the source code to the demo above
unit Main; {$mode delphi} interface uses Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls, StdCtrls, ExtDlgs, Codebot.System, Codebot.Graphics, Codebot.Graphics.Types, Codebot.Controls.Extras, Codebot.Controls.Sliders, Codebot.Controls.Colors; { TAlphaForm } type TAlphaForm = class(TForm) TopPanel: TPanel; LoadButton: TButton; ModeBox: TComboBox; AngleLabel: TLabel; AngleBar: TSlideBar; OpacityLabel: TLabel; OpacityBar: TSlideBar; SaturationLabel: TLabel; SaturationBar: TSlideBar; AlphaImage: TAlphaImage; Spacer: TLabel; OpenPictureDialog: TOpenPictureDialog; HuePicker: THuePicker; SaturationPicker: TSaturationPicker; ColorizeBox: TCheckBox; procedure AngleBarChange(Sender: TObject); procedure ColorizeBoxChange(Sender: TObject); procedure LoadButtonClick(Sender: TObject); procedure ModeBoxChange(Sender: TObject); procedure OpacityBarChange(Sender: TObject); procedure SaturationBarChange(Sender: TObject); procedure SaturationPickerChange(Sender: TObject); end; var AlphaForm: TAlphaForm; implementation {$R *.lfm} { TAlphaForm } procedure TAlphaForm.LoadButtonClick(Sender: TObject); begin if OpenPictureDialog.Execute then AlphaImage.Image.LoadFromFile(OpenPictureDialog.FileName); end; procedure TAlphaForm.AngleBarChange(Sender: TObject); begin AlphaImage.Angle := AngleBar.Position; end; procedure TAlphaForm.ModeBoxChange(Sender: TObject); begin AlphaImage.Mode := TImageMode(ModeBox.ItemIndex); end; procedure TAlphaForm.OpacityBarChange(Sender: TObject); begin AlphaImage.Opacity := Round(OpacityBar.Position); end; procedure TAlphaForm.SaturationBarChange(Sender: TObject); begin AlphaImage.Saturation := SaturationBar.Position; end; procedure TAlphaForm.SaturationPickerChange(Sender: TObject); begin AlphaImage.Color := SaturationPicker.ColorValue.Color; end; procedure TAlphaForm.ColorizeBoxChange(Sender: TObject); begin AlphaImage.Colorized := ColorizeBox.Checked; end; end.