You've already forked lazarus-ccr
Color institution brush tool works.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@1612 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -68,6 +68,7 @@ type
|
|||||||
procedure Brightness(ValueChange: integer);
|
procedure Brightness(ValueChange: integer);
|
||||||
procedure Contrast(ValueChange: integer);
|
procedure Contrast(ValueChange: integer);
|
||||||
procedure ColorReplace(ColorFrom, ColorTo: TColor);
|
procedure ColorReplace(ColorFrom, ColorTo: TColor);
|
||||||
|
procedure ReplaceRectColor(ColorFrom, ColorTo: TColor; aRect: TRect; R: integer; Shape: TShapeType);
|
||||||
property ScanLine[Row: integer]: pRGBATriple read GetScanLine;
|
property ScanLine[Row: integer]: pRGBATriple read GetScanLine;
|
||||||
procedure FillEllipse(X1, Y1, X2, Y2: integer); virtual;
|
procedure FillEllipse(X1, Y1, X2, Y2: integer); virtual;
|
||||||
procedure CutToClipboard; virtual;
|
procedure CutToClipboard; virtual;
|
||||||
@ -539,6 +540,32 @@ begin
|
|||||||
DLBMPColorReplace(Self, ColorFrom, ColorTo);
|
DLBMPColorReplace(Self, ColorFrom, ColorTo);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TDLBitmap.ReplaceRectColor(ColorFrom, ColorTo: TColor; aRect: TRect; R: integer; Shape: TShapeType);
|
||||||
|
var maskbmp: TDLBitmap; i, j: integer;
|
||||||
|
begin
|
||||||
|
maskbmp := TDLBitmap.Create;
|
||||||
|
maskbmp.Width := aRect.Right - aRect.Left;
|
||||||
|
maskbmp.Height := aRect.Bottom - aRect.Top;
|
||||||
|
maskbmp.Canvas.Brush.Color := clWhite;
|
||||||
|
maskbmp.Canvas.Brush.Style := bsSolid;
|
||||||
|
maskbmp.Canvas.Pen.Color := clWhite;
|
||||||
|
maskbmp.Canvas.Rectangle(0, 0, Width, Height);
|
||||||
|
maskbmp.Canvas.Brush.Color := clBlack;
|
||||||
|
maskbmp.Canvas.Pen.Color := clBlack;
|
||||||
|
case Shape of
|
||||||
|
stRectangle: maskbmp.Canvas.Rectangle(0, 0, maskbmp.Width, maskbmp.Height);
|
||||||
|
stRoundRect: maskbmp.Canvas.RoundRect(0, 0, maskbmp.Width, maskbmp.Height, R, R);
|
||||||
|
stEllipse : maskbmp.Canvas.Ellipse(0, 0, maskbmp.Width, maskbmp.Height);
|
||||||
|
end;
|
||||||
|
for i := 0 to maskbmp.Width do
|
||||||
|
for j := 0 to maskbmp.Height do
|
||||||
|
if maskbmp.Pixels[i, j] = clBlack then
|
||||||
|
if Pixels[aRect.Left + i, aRect.Top + j] = ColorFrom then
|
||||||
|
Pixels[aRect.Left + i, aRect.Top + j] := ColorTo;
|
||||||
|
InvalidateScanline;
|
||||||
|
maskbmp.Free;
|
||||||
|
end;
|
||||||
|
|
||||||
constructor TTextEdit.Create(AOwner: TComponent);
|
constructor TTextEdit.Create(AOwner: TComponent);
|
||||||
begin
|
begin
|
||||||
inherited;
|
inherited;
|
||||||
|
@ -41,7 +41,7 @@
|
|||||||
<PackageName Value="LCL"/>
|
<PackageName Value="LCL"/>
|
||||||
</Item3>
|
</Item3>
|
||||||
</RequiredPackages>
|
</RequiredPackages>
|
||||||
<Units Count="44">
|
<Units Count="45">
|
||||||
<Unit0>
|
<Unit0>
|
||||||
<Filename Value="lazimageeditor.pas"/>
|
<Filename Value="lazimageeditor.pas"/>
|
||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
@ -49,7 +49,7 @@
|
|||||||
<WindowIndex Value="0"/>
|
<WindowIndex Value="0"/>
|
||||||
<TopLine Value="1"/>
|
<TopLine Value="1"/>
|
||||||
<CursorPos X="14" Y="4"/>
|
<CursorPos X="14" Y="4"/>
|
||||||
<UsageCount Value="77"/>
|
<UsageCount Value="78"/>
|
||||||
</Unit0>
|
</Unit0>
|
||||||
<Unit1>
|
<Unit1>
|
||||||
<Filename Value="main.pas"/>
|
<Filename Value="main.pas"/>
|
||||||
@ -60,21 +60,20 @@
|
|||||||
<UnitName Value="Main"/>
|
<UnitName Value="Main"/>
|
||||||
<EditorIndex Value="0"/>
|
<EditorIndex Value="0"/>
|
||||||
<WindowIndex Value="0"/>
|
<WindowIndex Value="0"/>
|
||||||
<TopLine Value="801"/>
|
<TopLine Value="1348"/>
|
||||||
<CursorPos X="34" Y="812"/>
|
<CursorPos X="87" Y="1356"/>
|
||||||
<UsageCount Value="77"/>
|
<UsageCount Value="78"/>
|
||||||
<Loaded Value="True"/>
|
<Loaded Value="True"/>
|
||||||
<LoadedDesigner Value="True"/>
|
<LoadedDesigner Value="True"/>
|
||||||
</Unit1>
|
</Unit1>
|
||||||
<Unit2>
|
<Unit2>
|
||||||
<Filename Value="picturectrls.pas"/>
|
<Filename Value="picturectrls.pas"/>
|
||||||
<UnitName Value="PictureCtrls"/>
|
<UnitName Value="PictureCtrls"/>
|
||||||
<IsVisibleTab Value="True"/>
|
<EditorIndex Value="2"/>
|
||||||
<EditorIndex Value="1"/>
|
|
||||||
<WindowIndex Value="0"/>
|
<WindowIndex Value="0"/>
|
||||||
<TopLine Value="874"/>
|
<TopLine Value="897"/>
|
||||||
<CursorPos X="17" Y="890"/>
|
<CursorPos X="41" Y="904"/>
|
||||||
<UsageCount Value="32"/>
|
<UsageCount Value="33"/>
|
||||||
<Loaded Value="True"/>
|
<Loaded Value="True"/>
|
||||||
</Unit2>
|
</Unit2>
|
||||||
<Unit3>
|
<Unit3>
|
||||||
@ -177,10 +176,12 @@
|
|||||||
<Unit13>
|
<Unit13>
|
||||||
<Filename Value="picturemanager.pas"/>
|
<Filename Value="picturemanager.pas"/>
|
||||||
<UnitName Value="PictureManager"/>
|
<UnitName Value="PictureManager"/>
|
||||||
|
<EditorIndex Value="1"/>
|
||||||
<WindowIndex Value="0"/>
|
<WindowIndex Value="0"/>
|
||||||
<TopLine Value="1"/>
|
<TopLine Value="30"/>
|
||||||
<CursorPos X="95" Y="2"/>
|
<CursorPos X="53" Y="46"/>
|
||||||
<UsageCount Value="33"/>
|
<UsageCount Value="33"/>
|
||||||
|
<Loaded Value="True"/>
|
||||||
</Unit13>
|
</Unit13>
|
||||||
<Unit14>
|
<Unit14>
|
||||||
<Filename Value="T:\ajlazctrls\dbdemo\bmprgbgraph.pas"/>
|
<Filename Value="T:\ajlazctrls\dbdemo\bmprgbgraph.pas"/>
|
||||||
@ -241,11 +242,11 @@
|
|||||||
<Unit21>
|
<Unit21>
|
||||||
<Filename Value="bmprgbtypes.pas"/>
|
<Filename Value="bmprgbtypes.pas"/>
|
||||||
<UnitName Value="BmpRGBTypes"/>
|
<UnitName Value="BmpRGBTypes"/>
|
||||||
<EditorIndex Value="2"/>
|
<EditorIndex Value="3"/>
|
||||||
<WindowIndex Value="0"/>
|
<WindowIndex Value="0"/>
|
||||||
<TopLine Value="107"/>
|
<TopLine Value="1"/>
|
||||||
<CursorPos X="46" Y="116"/>
|
<CursorPos X="97" Y="5"/>
|
||||||
<UsageCount Value="28"/>
|
<UsageCount Value="29"/>
|
||||||
<Loaded Value="True"/>
|
<Loaded Value="True"/>
|
||||||
</Unit21>
|
</Unit21>
|
||||||
<Unit22>
|
<Unit22>
|
||||||
@ -356,11 +357,12 @@
|
|||||||
<Unit35>
|
<Unit35>
|
||||||
<Filename Value="DLBitmap.pas"/>
|
<Filename Value="DLBitmap.pas"/>
|
||||||
<UnitName Value="DLBitmap"/>
|
<UnitName Value="DLBitmap"/>
|
||||||
<EditorIndex Value="3"/>
|
<IsVisibleTab Value="True"/>
|
||||||
|
<EditorIndex Value="4"/>
|
||||||
<WindowIndex Value="0"/>
|
<WindowIndex Value="0"/>
|
||||||
<TopLine Value="42"/>
|
<TopLine Value="541"/>
|
||||||
<CursorPos X="1" Y="52"/>
|
<CursorPos X="69" Y="558"/>
|
||||||
<UsageCount Value="16"/>
|
<UsageCount Value="17"/>
|
||||||
<Loaded Value="True"/>
|
<Loaded Value="True"/>
|
||||||
</Unit35>
|
</Unit35>
|
||||||
<Unit36>
|
<Unit36>
|
||||||
@ -389,11 +391,11 @@
|
|||||||
</Unit38>
|
</Unit38>
|
||||||
<Unit39>
|
<Unit39>
|
||||||
<Filename Value="DLBmpUtils.inc"/>
|
<Filename Value="DLBmpUtils.inc"/>
|
||||||
<EditorIndex Value="4"/>
|
<EditorIndex Value="5"/>
|
||||||
<WindowIndex Value="0"/>
|
<WindowIndex Value="0"/>
|
||||||
<TopLine Value="672"/>
|
<TopLine Value="672"/>
|
||||||
<CursorPos X="11" Y="686"/>
|
<CursorPos X="11" Y="686"/>
|
||||||
<UsageCount Value="14"/>
|
<UsageCount Value="15"/>
|
||||||
<Loaded Value="True"/>
|
<Loaded Value="True"/>
|
||||||
</Unit39>
|
</Unit39>
|
||||||
<Unit40>
|
<Unit40>
|
||||||
@ -426,127 +428,135 @@
|
|||||||
<CursorPos X="15" Y="29"/>
|
<CursorPos X="15" Y="29"/>
|
||||||
<UsageCount Value="10"/>
|
<UsageCount Value="10"/>
|
||||||
</Unit43>
|
</Unit43>
|
||||||
|
<Unit44>
|
||||||
|
<Filename Value="T:\fpclaz\laz\lcl\extctrls.pp"/>
|
||||||
|
<UnitName Value="ExtCtrls"/>
|
||||||
|
<WindowIndex Value="0"/>
|
||||||
|
<TopLine Value="427"/>
|
||||||
|
<CursorPos X="14" Y="444"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit44>
|
||||||
</Units>
|
</Units>
|
||||||
<JumpHistory Count="30" HistoryIndex="29">
|
<JumpHistory Count="30" HistoryIndex="29">
|
||||||
<Position1>
|
<Position1>
|
||||||
<Filename Value="DLBmpUtils.inc"/>
|
<Filename Value="main.pas"/>
|
||||||
<Caret Line="695" Column="61" TopLine="676"/>
|
<Caret Line="3" Column="95" TopLine="1"/>
|
||||||
</Position1>
|
</Position1>
|
||||||
<Position2>
|
<Position2>
|
||||||
<Filename Value="picturectrls.pas"/>
|
<Filename Value="main.pas"/>
|
||||||
<Caret Line="4" Column="90" TopLine="1"/>
|
<Caret Line="503" Column="8" TopLine="487"/>
|
||||||
</Position2>
|
</Position2>
|
||||||
<Position3>
|
<Position3>
|
||||||
<Filename Value="picturectrls.pas"/>
|
<Filename Value="main.pas"/>
|
||||||
<Caret Line="114" Column="63" TopLine="88"/>
|
<Caret Line="308" Column="22" TopLine="292"/>
|
||||||
</Position3>
|
</Position3>
|
||||||
<Position4>
|
<Position4>
|
||||||
<Filename Value="picturectrls.pas"/>
|
<Filename Value="picturectrls.pas"/>
|
||||||
<Caret Line="174" Column="20" TopLine="157"/>
|
<Caret Line="123" Column="21" TopLine="113"/>
|
||||||
</Position4>
|
</Position4>
|
||||||
<Position5>
|
<Position5>
|
||||||
<Filename Value="picturectrls.pas"/>
|
<Filename Value="picturemanager.pas"/>
|
||||||
<Caret Line="438" Column="10" TopLine="427"/>
|
<Caret Line="3" Column="93" TopLine="34"/>
|
||||||
</Position5>
|
</Position5>
|
||||||
<Position6>
|
<Position6>
|
||||||
<Filename Value="picturectrls.pas"/>
|
<Filename Value="picturemanager.pas"/>
|
||||||
<Caret Line="643" Column="19" TopLine="617"/>
|
<Caret Line="46" Column="30" TopLine="34"/>
|
||||||
</Position6>
|
</Position6>
|
||||||
<Position7>
|
<Position7>
|
||||||
<Filename Value="picturectrls.pas"/>
|
<Filename Value="main.pas"/>
|
||||||
<Caret Line="663" Column="21" TopLine="637"/>
|
<Caret Line="308" Column="22" TopLine="292"/>
|
||||||
</Position7>
|
</Position7>
|
||||||
<Position8>
|
<Position8>
|
||||||
<Filename Value="picturectrls.pas"/>
|
<Filename Value="main.pas"/>
|
||||||
<Caret Line="739" Column="15" TopLine="713"/>
|
<Caret Line="503" Column="7" TopLine="487"/>
|
||||||
</Position8>
|
</Position8>
|
||||||
<Position9>
|
<Position9>
|
||||||
<Filename Value="picturectrls.pas"/>
|
<Filename Value="main.pas"/>
|
||||||
<Caret Line="757" Column="15" TopLine="731"/>
|
<Caret Line="308" Column="22" TopLine="292"/>
|
||||||
</Position9>
|
</Position9>
|
||||||
<Position10>
|
<Position10>
|
||||||
<Filename Value="picturectrls.pas"/>
|
<Filename Value="picturemanager.pas"/>
|
||||||
<Caret Line="841" Column="84" TopLine="824"/>
|
<Caret Line="98" Column="41" TopLine="87"/>
|
||||||
</Position10>
|
</Position10>
|
||||||
<Position11>
|
<Position11>
|
||||||
<Filename Value="picturectrls.pas"/>
|
<Filename Value="picturemanager.pas"/>
|
||||||
<Caret Line="842" Column="25" TopLine="824"/>
|
<Caret Line="40" Column="3" TopLine="24"/>
|
||||||
</Position11>
|
</Position11>
|
||||||
<Position12>
|
<Position12>
|
||||||
<Filename Value="picturectrls.pas"/>
|
<Filename Value="main.pas"/>
|
||||||
<Caret Line="887" Column="25" TopLine="873"/>
|
<Caret Line="308" Column="22" TopLine="292"/>
|
||||||
</Position12>
|
</Position12>
|
||||||
<Position13>
|
<Position13>
|
||||||
<Filename Value="picturectrls.pas"/>
|
<Filename Value="main.pas"/>
|
||||||
<Caret Line="911" Column="30" TopLine="885"/>
|
<Caret Line="503" Column="49" TopLine="487"/>
|
||||||
</Position13>
|
</Position13>
|
||||||
<Position14>
|
<Position14>
|
||||||
<Filename Value="picturectrls.pas"/>
|
<Filename Value="main.pas"/>
|
||||||
<Caret Line="3" Column="85" TopLine="1"/>
|
<Caret Line="1123" Column="10" TopLine="1106"/>
|
||||||
</Position14>
|
</Position14>
|
||||||
<Position15>
|
<Position15>
|
||||||
<Filename Value="picturectrls.pas"/>
|
<Filename Value="main.pas"/>
|
||||||
<Caret Line="78" Column="20" TopLine="52"/>
|
<Caret Line="324" Column="41" TopLine="308"/>
|
||||||
</Position15>
|
</Position15>
|
||||||
<Position16>
|
<Position16>
|
||||||
<Filename Value="picturectrls.pas"/>
|
<Filename Value="picturectrls.pas"/>
|
||||||
<Caret Line="114" Column="33" TopLine="91"/>
|
<Caret Line="174" Column="28" TopLine="163"/>
|
||||||
</Position16>
|
</Position16>
|
||||||
<Position17>
|
<Position17>
|
||||||
<Filename Value="picturectrls.pas"/>
|
<Filename Value="picturectrls.pas"/>
|
||||||
<Caret Line="172" Column="20" TopLine="146"/>
|
<Caret Line="644" Column="35" TopLine="618"/>
|
||||||
</Position17>
|
</Position17>
|
||||||
<Position18>
|
<Position18>
|
||||||
<Filename Value="picturectrls.pas"/>
|
<Filename Value="picturectrls.pas"/>
|
||||||
<Caret Line="477" Column="35" TopLine="451"/>
|
<Caret Line="666" Column="37" TopLine="640"/>
|
||||||
</Position18>
|
</Position18>
|
||||||
<Position19>
|
<Position19>
|
||||||
<Filename Value="picturectrls.pas"/>
|
<Filename Value="main.pas"/>
|
||||||
<Caret Line="479" Column="20" TopLine="453"/>
|
<Caret Line="324" Column="41" TopLine="308"/>
|
||||||
</Position19>
|
</Position19>
|
||||||
<Position20>
|
<Position20>
|
||||||
<Filename Value="picturectrls.pas"/>
|
<Filename Value="main.pas"/>
|
||||||
<Caret Line="640" Column="20" TopLine="614"/>
|
<Caret Line="4" Column="101" TopLine="1"/>
|
||||||
</Position20>
|
</Position20>
|
||||||
<Position21>
|
<Position21>
|
||||||
<Filename Value="picturectrls.pas"/>
|
<Filename Value="main.pas"/>
|
||||||
<Caret Line="661" Column="23" TopLine="635"/>
|
<Caret Line="156" Column="58" TopLine="150"/>
|
||||||
</Position21>
|
</Position21>
|
||||||
<Position22>
|
<Position22>
|
||||||
<Filename Value="picturectrls.pas"/>
|
<Filename Value="main.pas"/>
|
||||||
<Caret Line="191" Column="95" TopLine="185"/>
|
<Caret Line="176" Column="22" TopLine="150"/>
|
||||||
</Position22>
|
</Position22>
|
||||||
<Position23>
|
<Position23>
|
||||||
<Filename Value="picturectrls.pas"/>
|
<Filename Value="main.pas"/>
|
||||||
<Caret Line="640" Column="21" TopLine="614"/>
|
<Caret Line="278" Column="32" TopLine="252"/>
|
||||||
</Position23>
|
</Position23>
|
||||||
<Position24>
|
<Position24>
|
||||||
<Filename Value="picturectrls.pas"/>
|
<Filename Value="main.pas"/>
|
||||||
<Caret Line="661" Column="23" TopLine="635"/>
|
<Caret Line="69" Column="94" TopLine="66"/>
|
||||||
</Position24>
|
</Position24>
|
||||||
<Position25>
|
<Position25>
|
||||||
<Filename Value="picturectrls.pas"/>
|
<Filename Value="main.pas"/>
|
||||||
<Caret Line="890" Column="30" TopLine="874"/>
|
<Caret Line="503" Column="37" TopLine="480"/>
|
||||||
</Position25>
|
</Position25>
|
||||||
<Position26>
|
<Position26>
|
||||||
<Filename Value="bmprgbtypes.pas"/>
|
<Filename Value="main.pas"/>
|
||||||
<Caret Line="123" Column="21" TopLine="107"/>
|
<Caret Line="29" Column="75" TopLine="23"/>
|
||||||
</Position26>
|
</Position26>
|
||||||
<Position27>
|
<Position27>
|
||||||
<Filename Value="DLBitmap.pas"/>
|
<Filename Value="main.pas"/>
|
||||||
<Caret Line="72" Column="26" TopLine="56"/>
|
<Caret Line="45" Column="17" TopLine="23"/>
|
||||||
</Position27>
|
</Position27>
|
||||||
<Position28>
|
<Position28>
|
||||||
<Filename Value="DLBitmap.pas"/>
|
<Filename Value="picturectrls.pas"/>
|
||||||
<Caret Line="533" Column="32" TopLine="515"/>
|
<Caret Line="904" Column="41" TopLine="899"/>
|
||||||
</Position28>
|
</Position28>
|
||||||
<Position29>
|
<Position29>
|
||||||
<Filename Value="DLBitmap.pas"/>
|
<Filename Value="picturectrls.pas"/>
|
||||||
<Caret Line="534" Column="32" TopLine="517"/>
|
<Caret Line="214" Column="38" TopLine="198"/>
|
||||||
</Position29>
|
</Position29>
|
||||||
<Position30>
|
<Position30>
|
||||||
<Filename Value="DLBitmap.pas"/>
|
<Filename Value="main.pas"/>
|
||||||
<Caret Line="532" Column="27" TopLine="514"/>
|
<Caret Line="503" Column="87" TopLine="80"/>
|
||||||
</Position30>
|
</Position30>
|
||||||
</JumpHistory>
|
</JumpHistory>
|
||||||
</ProjectOptions>
|
</ProjectOptions>
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
object MainForm: TMainForm
|
object MainForm: TMainForm
|
||||||
Left = 150
|
Left = 90
|
||||||
Height = 681
|
Height = 681
|
||||||
Top = 63
|
Top = 90
|
||||||
Width = 920
|
Width = 920
|
||||||
Caption = 'Lazarus Image Editor'
|
Caption = 'Lazarus Image Editor'
|
||||||
ClientHeight = 661
|
ClientHeight = 659
|
||||||
ClientWidth = 920
|
ClientWidth = 920
|
||||||
Font.CharSet = GB2312_CHARSET
|
Font.CharSet = GB2312_CHARSET
|
||||||
Font.Height = -13
|
Font.Height = -13
|
||||||
@ -18,18 +18,18 @@
|
|||||||
LCLVersion = '0.9.31'
|
LCLVersion = '0.9.31'
|
||||||
object PanelTools: TPanel
|
object PanelTools: TPanel
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 534
|
Height = 532
|
||||||
Top = 105
|
Top = 105
|
||||||
Width = 40
|
Width = 40
|
||||||
Align = alLeft
|
Align = alLeft
|
||||||
BevelOuter = bvNone
|
BevelOuter = bvNone
|
||||||
ClientHeight = 534
|
ClientHeight = 532
|
||||||
ClientWidth = 40
|
ClientWidth = 40
|
||||||
ParentColor = False
|
ParentColor = False
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
object ToolBarTools: TToolBar
|
object ToolBarTools: TToolBar
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 534
|
Height = 532
|
||||||
Top = 0
|
Top = 0
|
||||||
Width = 40
|
Width = 40
|
||||||
Align = alLeft
|
Align = alLeft
|
||||||
@ -160,22 +160,32 @@
|
|||||||
Grouped = True
|
Grouped = True
|
||||||
ImageIndex = 5
|
ImageIndex = 5
|
||||||
OnClick = ToolBrushClick
|
OnClick = ToolBrushClick
|
||||||
|
Style = tbsCheck
|
||||||
end
|
end
|
||||||
object ToolText: TToolButton
|
object ToolText: TToolButton
|
||||||
Left = 0
|
Left = 0
|
||||||
Hint = 'Text'
|
Hint = 'Text'
|
||||||
Top = 442
|
Top = 442
|
||||||
Caption = 'ToolBrush'
|
|
||||||
Grouped = True
|
Grouped = True
|
||||||
ImageIndex = 5
|
ImageIndex = 5
|
||||||
OnClick = ToolTextClick
|
OnClick = ToolTextClick
|
||||||
|
Style = tbsCheck
|
||||||
|
end
|
||||||
|
object ToolcolorReplacer: TToolButton
|
||||||
|
Left = 0
|
||||||
|
Hint = 'Institute Color'
|
||||||
|
Top = 482
|
||||||
|
Grouped = True
|
||||||
|
ImageIndex = 5
|
||||||
|
OnClick = ToolcolorReplacerClick
|
||||||
|
Style = tbsCheck
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
object StatusBar: TStatusBar
|
object StatusBar: TStatusBar
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 22
|
Height = 22
|
||||||
Top = 639
|
Top = 637
|
||||||
Width = 920
|
Width = 920
|
||||||
Panels = <
|
Panels = <
|
||||||
item
|
item
|
||||||
@ -202,18 +212,18 @@
|
|||||||
end
|
end
|
||||||
object PanelPallete: TPanel
|
object PanelPallete: TPanel
|
||||||
Left = 845
|
Left = 845
|
||||||
Height = 534
|
Height = 532
|
||||||
Top = 105
|
Top = 105
|
||||||
Width = 75
|
Width = 75
|
||||||
Align = alRight
|
Align = alRight
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
BevelOuter = bvNone
|
BevelOuter = bvNone
|
||||||
ClientHeight = 534
|
ClientHeight = 532
|
||||||
ClientWidth = 75
|
ClientWidth = 75
|
||||||
TabOrder = 1
|
TabOrder = 1
|
||||||
object Palette: TColorPalette
|
object Palette: TColorPalette
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 534
|
Height = 532
|
||||||
Top = 0
|
Top = 0
|
||||||
Width = 75
|
Width = 75
|
||||||
Align = alClient
|
Align = alClient
|
||||||
@ -1375,9 +1385,9 @@
|
|||||||
TabOrder = 5
|
TabOrder = 5
|
||||||
object checkFuzzy: TCheckBox
|
object checkFuzzy: TCheckBox
|
||||||
Left = 4
|
Left = 4
|
||||||
Height = 21
|
Height = 23
|
||||||
Top = 5
|
Top = 5
|
||||||
Width = 22
|
Width = 24
|
||||||
OnChange = checkFuzzyChange
|
OnChange = checkFuzzyChange
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
end
|
end
|
||||||
@ -1386,7 +1396,7 @@
|
|||||||
end
|
end
|
||||||
object PanelPictures: TPanel
|
object PanelPictures: TPanel
|
||||||
Left = 40
|
Left = 40
|
||||||
Height = 534
|
Height = 532
|
||||||
Top = 105
|
Top = 105
|
||||||
Width = 805
|
Width = 805
|
||||||
Align = alClient
|
Align = alClient
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -173,6 +173,7 @@ type
|
|||||||
ToolBrush: TToolButton;
|
ToolBrush: TToolButton;
|
||||||
ToolButton1: TToolButton;
|
ToolButton1: TToolButton;
|
||||||
ToolText: TToolButton;
|
ToolText: TToolButton;
|
||||||
|
ToolcolorReplacer: TToolButton;
|
||||||
ZoomInBtn: TToolButton;
|
ZoomInBtn: TToolButton;
|
||||||
ZoomOutBtn: TToolButton;
|
ZoomOutBtn: TToolButton;
|
||||||
ToolCircleShape: TSpeedButton;
|
ToolCircleShape: TSpeedButton;
|
||||||
@ -274,6 +275,7 @@ type
|
|||||||
procedure spinFillAlphaChange(Sender: TObject);
|
procedure spinFillAlphaChange(Sender: TObject);
|
||||||
procedure ToolBarToolsClick(Sender: TObject);
|
procedure ToolBarToolsClick(Sender: TObject);
|
||||||
procedure ToolBrushClick(Sender: TObject);
|
procedure ToolBrushClick(Sender: TObject);
|
||||||
|
procedure ToolcolorReplacerClick(Sender: TObject);
|
||||||
procedure ToolTextClick(Sender: TObject);
|
procedure ToolTextClick(Sender: TObject);
|
||||||
procedure ZoomInBtnClick(Sender: TObject);
|
procedure ZoomInBtnClick(Sender: TObject);
|
||||||
procedure ZoomOutBtnClick(Sender: TObject);
|
procedure ZoomOutBtnClick(Sender: TObject);
|
||||||
@ -493,6 +495,14 @@ begin
|
|||||||
ChangeTool(ptBrush);
|
ChangeTool(ptBrush);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TMainForm.ToolcolorReplacerClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if not Pictures.CanEdit then
|
||||||
|
Exit;
|
||||||
|
ChangeTool(ptColorReplacer);
|
||||||
|
ActivePictureEdit.ChangeColor(BtnFromColor.ButtonColor, BtnToColor.ButtonColor);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TMainForm.ToolTextClick(Sender: TObject);
|
procedure TMainForm.ToolTextClick(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
if not Pictures.CanEdit then
|
if not Pictures.CanEdit then
|
||||||
@ -1343,7 +1353,7 @@ end;
|
|||||||
|
|
||||||
procedure TMainForm.BtnToColorClick(Sender: TObject);
|
procedure TMainForm.BtnToColorClick(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
|
ActivePictureEdit.ChangeColor(BtnFromColor.ButtonColor, BtnToColor.ButtonColor);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TMainForm.EditSizeChange(Sender: TObject);
|
procedure TMainForm.EditSizeChange(Sender: TObject);
|
||||||
|
@ -111,7 +111,7 @@ type
|
|||||||
tdRoundRectangle, tdPolygon);
|
tdRoundRectangle, tdPolygon);
|
||||||
|
|
||||||
TPictureEditTool = (ptLine, ptPen, ptRectangle, ptFloodFill, ptEllipse,
|
TPictureEditTool = (ptLine, ptPen, ptRectangle, ptFloodFill, ptEllipse,
|
||||||
ptMask, ptColorPick, ptEraser, ptSpray, ptPolygon, ptBrush, ptText);
|
ptMask, ptColorPick, ptEraser, ptSpray, ptPolygon, ptBrush, ptText, ptColorReplacer);
|
||||||
|
|
||||||
TPicturePos = (ppTopLeft, ppTopCenter, ppTopRight, ppCenterLeft, ppCentered,
|
TPicturePos = (ppTopLeft, ppTopCenter, ppTopRight, ppCenterLeft, ppCentered,
|
||||||
ppCenterRight, ppBottomLeft, ppBottomCenter, ppBottomRight);
|
ppCenterRight, ppBottomLeft, ppBottomCenter, ppBottomRight);
|
||||||
@ -147,6 +147,7 @@ type
|
|||||||
procedure SetPaperColor(const AValue: TColor);
|
procedure SetPaperColor(const AValue: TColor);
|
||||||
procedure SetTool(const AValue: TPictureEditTool);
|
procedure SetTool(const AValue: TPictureEditTool);
|
||||||
protected
|
protected
|
||||||
|
FromColor, ToColor: TColor;
|
||||||
procedure Change; dynamic;
|
procedure Change; dynamic;
|
||||||
procedure ColorChange; dynamic;
|
procedure ColorChange; dynamic;
|
||||||
procedure PictureSizeChange; dynamic;
|
procedure PictureSizeChange; dynamic;
|
||||||
@ -170,6 +171,7 @@ type
|
|||||||
procedure FloodFill(X, Y: integer; Shift: TShiftState = [ssLeft]);
|
procedure FloodFill(X, Y: integer; Shift: TShiftState = [ssLeft]);
|
||||||
procedure MaskFloodFill(X, Y: integer; Shift: TShiftState = [ssLeft]);
|
procedure MaskFloodFill(X, Y: integer; Shift: TShiftState = [ssLeft]);
|
||||||
procedure Eraser(X, Y: integer; Shift: TShiftState = [ssLeft]);
|
procedure Eraser(X, Y: integer; Shift: TShiftState = [ssLeft]);
|
||||||
|
procedure ColorReplacer(X, Y: integer; Shift: TShiftState = [ssLeft]);
|
||||||
procedure Spray(X, Y: integer; Shift: TShiftState = [ssLeft]);
|
procedure Spray(X, Y: integer; Shift: TShiftState = [ssLeft]);
|
||||||
procedure Brush(X, Y: integer; Shift: TShiftState = [ssLeft]);
|
procedure Brush(X, Y: integer; Shift: TShiftState = [ssLeft]);
|
||||||
procedure Line(X1, Y1, X2, Y2: integer; Shift: TShiftState = [ssLeft]);
|
procedure Line(X1, Y1, X2, Y2: integer; Shift: TShiftState = [ssLeft]);
|
||||||
@ -209,6 +211,7 @@ type
|
|||||||
procedure BeginDraw;
|
procedure BeginDraw;
|
||||||
procedure EndDraw;
|
procedure EndDraw;
|
||||||
procedure UpdatePicture;
|
procedure UpdatePicture;
|
||||||
|
procedure ChangeColor(FrColor, taColor: TColor);
|
||||||
public
|
public
|
||||||
TextEditor: TTextEditor;
|
TextEditor: TTextEditor;
|
||||||
property DrawMode: TDrawMode read FDrawMode write FDrawMode;
|
property DrawMode: TDrawMode read FDrawMode write FDrawMode;
|
||||||
@ -638,6 +641,7 @@ begin
|
|||||||
MaskFloodFill(X, Y, Shift);
|
MaskFloodFill(X, Y, Shift);
|
||||||
ptColorPick: ColorPick(X, Y, Shift);
|
ptColorPick: ColorPick(X, Y, Shift);
|
||||||
ptEraser: Eraser(X, Y, Shift);
|
ptEraser: Eraser(X, Y, Shift);
|
||||||
|
ptColorReplacer: ColorReplacer(X, Y, Shift);
|
||||||
ptSpray: Spray(X, Y, Shift);
|
ptSpray: Spray(X, Y, Shift);
|
||||||
ptText: ProcessEditorText(X, Y, X, Y);
|
ptText: ProcessEditorText(X, Y, X, Y);
|
||||||
ptBrush: Brush(X, Y, Shift);
|
ptBrush: Brush(X, Y, Shift);
|
||||||
@ -659,6 +663,7 @@ begin
|
|||||||
Line(FTempPos.X, FTempPos.Y, X, Y, Shift);
|
Line(FTempPos.X, FTempPos.Y, X, Y, Shift);
|
||||||
end;
|
end;
|
||||||
ptEraser: Eraser(X, Y, Shift);
|
ptEraser: Eraser(X, Y, Shift);
|
||||||
|
ptColorReplacer: ColorReplacer(X, Y, Shift);
|
||||||
ptSpray: Spray(X, Y, Shift);
|
ptSpray: Spray(X, Y, Shift);
|
||||||
ptBrush: Brush(X, Y, Shift);
|
ptBrush: Brush(X, Y, Shift);
|
||||||
ptColorPick: ColorPick(X, Y, Shift);
|
ptColorPick: ColorPick(X, Y, Shift);
|
||||||
@ -896,6 +901,39 @@ begin
|
|||||||
InvalidatePictureRect(R);
|
InvalidatePictureRect(R);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCustomPictureEdit.ChangeColor(FrColor, TaColor: TColor);
|
||||||
|
begin
|
||||||
|
FromColor := FrColor;
|
||||||
|
ToColor := TaColor;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCustomPictureEdit.ColorReplacer(X, Y: integer; Shift: TShiftState = [ssLeft]);
|
||||||
|
var
|
||||||
|
R: TRect;
|
||||||
|
begin
|
||||||
|
if Picture = nil then
|
||||||
|
Exit;
|
||||||
|
|
||||||
|
BeginDraw;
|
||||||
|
if ssLeft in Shift then
|
||||||
|
Picture.EraseMode := ermErase;
|
||||||
|
if ssRight in Shift then
|
||||||
|
Picture.EraseMode := ermReplace;
|
||||||
|
try
|
||||||
|
R := Bounds(X - FSize div 2, Y - FSize div 2, FSize, FSize);
|
||||||
|
Picture.Canvas.Pen.Color := FPaperColor;
|
||||||
|
Picture.Canvas.Brush.Color := FpaperColor;
|
||||||
|
case Shape of
|
||||||
|
psRect: Picture.ReplaceRectColor(FromColor, ToColor, R, 6, stRoundRect);
|
||||||
|
psCircle: Picture.ReplaceRectColor(FromColor, ToColor, R, 6, stEllipse);
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
Picture.EraseMode := ermNone;
|
||||||
|
EndDraw;
|
||||||
|
end;
|
||||||
|
InvalidatePictureRect(R);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TCustomPictureEdit.Spray(X, Y: integer; Shift: TShiftState);
|
procedure TCustomPictureEdit.Spray(X, Y: integer; Shift: TShiftState);
|
||||||
var
|
var
|
||||||
R: TRect;
|
R: TRect;
|
||||||
|
Reference in New Issue
Block a user