Skip to content

Commit

Permalink
dev
Browse files Browse the repository at this point in the history
  • Loading branch information
ollydev committed Feb 12, 2024
1 parent 90c17d3 commit 623420e
Show file tree
Hide file tree
Showing 10 changed files with 215 additions and 249 deletions.
4 changes: 2 additions & 2 deletions Source/forms/simba.aca.lfm
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ object SimbaACAForm: TSimbaACAForm
Top = 375
Width = 1076
Caption = 'Auto Color Aid'
ClientHeight = 0
ClientWidth = 0
ClientHeight = 886
ClientWidth = 1076
Constraints.MinHeight = 400
Constraints.MinWidth = 500
DesignTimePPI = 120
Expand Down
24 changes: 12 additions & 12 deletions Source/forms/simba.aca.pas
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ interface
uses
Classes, SysUtils, Forms, Controls, Dialogs, DividerBevel, Graphics,
ExtCtrls, ComCtrls, StdCtrls, Menus, ColorBox, LMessages,
simba.base, simba.imagebox_new, simba.imagebox_canvas, {simba.imagebox_zoom,}
simba.base, simba.imagebox_new, simba.imagebox_canvas, simba.imagebox_zoom,
simba.colormath, simba.finder;

type
Expand Down Expand Up @@ -93,14 +93,14 @@ TSimbaACAForm = class(TForm)
FFreeOnClose: Boolean;
FWindow: TWindowHandle;
FImageBox: TSimbaImageBoxNew;
//FImageZoom: TSimbaImageBoxZoom;
FImageZoom: TSimbaImageBoxZoom;
FZoomInfo: TLabel;
FDebugTPA: TPointArray;
FDebugMat: TSingleMatrix;
FDrawColor: TColor;

procedure LoadHSLCircle(Radius: Integer);
procedure DoPaintArea(Sender: TObject; ACanvas: TSimbaImageBoxCanvas; R: TRect);
procedure DoPaintArea(Sender: TSimbaImageBoxNew; ACanvas: TSimbaImageBoxCanvas; R: TRect);
procedure CalculateBestColor;

function GetBestColorTol: TColorTolerance;
Expand All @@ -126,8 +126,8 @@ implementation

procedure TSimbaACAForm.ClientImageMouseMove(Sender: TSimbaImageBoxNew; Shift: TShiftState; X, Y: Integer);
begin
//FImageZoom.SetTempColor(-1);
//FImageZoom.MoveTest(FImageBox, X, Y);
FImageZoom.SetTempColor(-1);
FImageZoom.Move(FImageBox.Background.Canvas, X, Y);

with FImageBox.Background.Canvas.Pixels[X, Y].ToRGB(), FImageBox.Background.Canvas.Pixels[X, Y].ToHSL() do
FZoomInfo.Caption := Format('Color: %d', [FImageBox.Background.Canvas.Pixels[X, Y]]) + LineEnding +
Expand Down Expand Up @@ -188,7 +188,7 @@ procedure TSimbaACAForm.LoadHSLCircle(Radius: Integer);
Bitmap.Free();
end;

procedure TSimbaACAForm.DoPaintArea(Sender: TObject; ACanvas: TSimbaImageBoxCanvas; R: TRect);
procedure TSimbaACAForm.DoPaintArea(Sender: TSimbaImageBoxNew; ACanvas: TSimbaImageBoxCanvas; R: TRect);
begin
if (Length(FDebugTPA) > 0) then
ACanvas.DrawPoints(FDebugTPA, FDrawColor)
Expand Down Expand Up @@ -247,7 +247,7 @@ procedure TSimbaACAForm.ColorSelectionChanged(Sender: TObject; User: Boolean);
begin
if User and (ColorListBox.ItemIndex >= 0) then
begin
//FImageZoom.SetTempColor(ColorListBox.Selected);
FImageZoom.SetTempColor(ColorListBox.Selected);

with ColorListBox.Selected.ToRGB(), ColorListBox.Selected.ToHSL() do
FZoomInfo.Caption := Format('Color: %d', [ColorListBox.Selected]) + LineEnding +
Expand Down Expand Up @@ -469,15 +469,15 @@ constructor TSimbaACAForm.Create(Window: TWindowHandle);
FImageBox.OnImgPaint := @DoPaintArea;
FImageBox.SetBackgroundFromWindow(FWindow);

//FImageZoom := TSimbaImageBoxZoom.Create(Self);
//FImageZoom.Parent := PanelTop;
//FImageZoom.SetZoom(4, 5);
//FImageZoom.BorderSpacing.Around := 5;
FImageZoom := TSimbaImageBoxZoom.Create(Self);
FImageZoom.Parent := PanelTop;
FImageZoom.SetZoom(4, 5);
FImageZoom.BorderSpacing.Around := 5;

FZoomInfo := TLabel.Create(Self);
FZoomInfo.Parent := PanelTop;
FZoomInfo.BorderSpacing.Right := 10;
//FZoomInfo.AnchorToNeighbour(akLeft, 10, FImageZoom);
FZoomInfo.AnchorToNeighbour(akLeft, 10, FImageZoom);

FDrawColor := clRed;

Expand Down
Loading

0 comments on commit 623420e

Please sign in to comment.