You've already forked lazarus-ccr
fixed colorpalette bugs. now it works fine.
DLBitmap works fine on linux and windows now. git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@1581 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -16,7 +16,11 @@ type
|
||||
rgbtAlpha: byte;
|
||||
end;
|
||||
PRGBATriple = ^TRGBATriple;
|
||||
{$ifdef MSWINDOWS}
|
||||
TRGBATriple = tagRGBTRIPLE;
|
||||
{$else}
|
||||
TRGBATriple = tagRGBATRIPLE;
|
||||
{$endif}
|
||||
PRGBATripleArray = ^TRGBATripleArray;
|
||||
TRGBATripleArray = array[word] of TRGBATriple;
|
||||
|
||||
@ -87,11 +91,7 @@ begin
|
||||
Bmp := TDLBitmap.Create;
|
||||
Bmp.Width := aBitmap.Height;
|
||||
Bmp.Height := aBitmap.Width;
|
||||
{$ifdef MSWINDOWS}
|
||||
Bmp.PixelFormat := pf32bit;
|
||||
{$else}
|
||||
Bmp.PixelFormat := pf24bit;
|
||||
{$endif}
|
||||
IntfImg1 := TLazIntfImage.Create(0, 0);
|
||||
IntfImg1.LoadFromBitmap(Bmp.Handle, Bmp.MaskHandle);
|
||||
IntfImg2 := TLazIntfImage.Create(0, 0);
|
||||
@ -351,8 +351,6 @@ var
|
||||
begin
|
||||
Result := False;
|
||||
try
|
||||
if BitmapIn.PixelFormat <> pf24bit then
|
||||
Exit;
|
||||
with BitmapOut do
|
||||
begin
|
||||
Width := BitmapIn.Width;
|
||||
@ -433,11 +431,7 @@ end;
|
||||
constructor TDLBitmap.Create;
|
||||
begin
|
||||
inherited;
|
||||
{$ifdef MSWINDOWS}
|
||||
PixelFormat := pf32bit;
|
||||
{$else}
|
||||
PixelFormat := pf24bit;
|
||||
{$endif}
|
||||
FIntfImgA := TLazIntfImage.Create(0, 0);
|
||||
end;
|
||||
|
||||
|
@ -65,6 +65,7 @@ type
|
||||
FOnColorPick: TColorMouseEvent;
|
||||
FRows: Integer;
|
||||
FColors: TList;
|
||||
MX, MY: integer;
|
||||
function GetColors(Index: Integer): TColor;
|
||||
procedure SetButtonHeight(const AValue: Integer);
|
||||
procedure SetButtonWidth(const AValue: Integer);
|
||||
@ -180,6 +181,9 @@ procedure TCustomColorPalette.MouseDown(Button: TMouseButton;
|
||||
begin
|
||||
inherited;
|
||||
|
||||
MX := X;
|
||||
MY := Y;
|
||||
|
||||
X := X div FButtonWidth;
|
||||
Y := Y div FButtonHeight;
|
||||
|
||||
@ -197,7 +201,7 @@ end;
|
||||
procedure TCustomColorPalette.MouseUp(Button: TMouseButton;
|
||||
Shift: TShiftState; X, Y: Integer);
|
||||
begin
|
||||
if PickedColor <> clNone then
|
||||
if (PickedColor <> clNone) and (MX = X) and (MY = Y) then
|
||||
ColorPick(PickedColor, PickShift);
|
||||
inherited;
|
||||
end;
|
||||
|
@ -41,15 +41,17 @@
|
||||
<PackageName Value="LCL"/>
|
||||
</Item3>
|
||||
</RequiredPackages>
|
||||
<Units Count="37">
|
||||
<Units Count="38">
|
||||
<Unit0>
|
||||
<Filename Value="lazimageeditor.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="lazimageeditor"/>
|
||||
<EditorIndex Value="1"/>
|
||||
<WindowIndex Value="0"/>
|
||||
<TopLine Value="2"/>
|
||||
<CursorPos X="11" Y="26"/>
|
||||
<TopLine Value="1"/>
|
||||
<CursorPos X="73" Y="11"/>
|
||||
<UsageCount Value="62"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit0>
|
||||
<Unit1>
|
||||
<Filename Value="main.pas"/>
|
||||
@ -58,11 +60,10 @@
|
||||
<HasResources Value="True"/>
|
||||
<ResourceBaseClass Value="Form"/>
|
||||
<UnitName Value="Main"/>
|
||||
<IsVisibleTab Value="True"/>
|
||||
<EditorIndex Value="0"/>
|
||||
<WindowIndex Value="0"/>
|
||||
<TopLine Value="988"/>
|
||||
<CursorPos X="3" Y="1007"/>
|
||||
<TopLine Value="756"/>
|
||||
<CursorPos X="72" Y="769"/>
|
||||
<UsageCount Value="62"/>
|
||||
<Loaded Value="True"/>
|
||||
<LoadedDesigner Value="True"/>
|
||||
@ -70,9 +71,9 @@
|
||||
<Unit2>
|
||||
<Filename Value="picturectrls.pas"/>
|
||||
<UnitName Value="PictureCtrls"/>
|
||||
<EditorIndex Value="3"/>
|
||||
<EditorIndex Value="5"/>
|
||||
<WindowIndex Value="0"/>
|
||||
<TopLine Value="822"/>
|
||||
<TopLine Value="831"/>
|
||||
<CursorPos X="51" Y="849"/>
|
||||
<UsageCount Value="28"/>
|
||||
<Loaded Value="True"/>
|
||||
@ -177,7 +178,7 @@
|
||||
<Unit13>
|
||||
<Filename Value="picturemanager.pas"/>
|
||||
<UnitName Value="PictureManager"/>
|
||||
<EditorIndex Value="1"/>
|
||||
<EditorIndex Value="3"/>
|
||||
<WindowIndex Value="0"/>
|
||||
<TopLine Value="188"/>
|
||||
<CursorPos X="62" Y="103"/>
|
||||
@ -243,9 +244,9 @@
|
||||
<Unit21>
|
||||
<Filename Value="bmprgbtypes.pas"/>
|
||||
<UnitName Value="BmpRGBTypes"/>
|
||||
<EditorIndex Value="5"/>
|
||||
<EditorIndex Value="7"/>
|
||||
<WindowIndex Value="0"/>
|
||||
<TopLine Value="23"/>
|
||||
<TopLine Value="119"/>
|
||||
<CursorPos X="24" Y="44"/>
|
||||
<UsageCount Value="26"/>
|
||||
<Loaded Value="True"/>
|
||||
@ -276,9 +277,9 @@
|
||||
<Unit25>
|
||||
<Filename Value="bmprgbutils.pas"/>
|
||||
<UnitName Value="BmpRGBUtils"/>
|
||||
<EditorIndex Value="4"/>
|
||||
<EditorIndex Value="6"/>
|
||||
<WindowIndex Value="0"/>
|
||||
<TopLine Value="34"/>
|
||||
<TopLine Value="85"/>
|
||||
<CursorPos X="72" Y="5"/>
|
||||
<UsageCount Value="24"/>
|
||||
<Loaded Value="True"/>
|
||||
@ -302,10 +303,10 @@
|
||||
<Unit28>
|
||||
<Filename Value="bmprgbgraph.pas"/>
|
||||
<UnitName Value="BmpRGBGraph"/>
|
||||
<EditorIndex Value="6"/>
|
||||
<EditorIndex Value="8"/>
|
||||
<WindowIndex Value="0"/>
|
||||
<TopLine Value="47"/>
|
||||
<CursorPos X="59" Y="66"/>
|
||||
<TopLine Value="20"/>
|
||||
<CursorPos X="76" Y="25"/>
|
||||
<UsageCount Value="20"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit28>
|
||||
@ -362,7 +363,7 @@
|
||||
<Unit35>
|
||||
<Filename Value="DLBitmap.pas"/>
|
||||
<UnitName Value="DLBitmap"/>
|
||||
<EditorIndex Value="2"/>
|
||||
<EditorIndex Value="4"/>
|
||||
<WindowIndex Value="0"/>
|
||||
<TopLine Value="631"/>
|
||||
<CursorPos X="61" Y="336"/>
|
||||
@ -377,127 +378,138 @@
|
||||
<CursorPos X="53" Y="201"/>
|
||||
<UsageCount Value="10"/>
|
||||
</Unit36>
|
||||
<Unit37>
|
||||
<Filename Value="colorpalette.pas"/>
|
||||
<UnitName Value="ColorPalette"/>
|
||||
<IsVisibleTab Value="True"/>
|
||||
<EditorIndex Value="2"/>
|
||||
<WindowIndex Value="0"/>
|
||||
<TopLine Value="56"/>
|
||||
<CursorPos X="21" Y="68"/>
|
||||
<UsageCount Value="10"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit37>
|
||||
</Units>
|
||||
<JumpHistory Count="30" HistoryIndex="29">
|
||||
<Position1>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="248" Column="1" TopLine="229"/>
|
||||
<Caret Line="725" Column="35" TopLine="708"/>
|
||||
</Position1>
|
||||
<Position2>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="674" Column="3" TopLine="662"/>
|
||||
<Caret Line="286" Column="33" TopLine="270"/>
|
||||
</Position2>
|
||||
<Position3>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="687" Column="1" TopLine="675"/>
|
||||
<Caret Line="733" Column="68" TopLine="705"/>
|
||||
</Position3>
|
||||
<Position4>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="248" Column="1" TopLine="227"/>
|
||||
<Caret Line="1122" Column="10" TopLine="1120"/>
|
||||
</Position4>
|
||||
<Position5>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="692" Column="3" TopLine="689"/>
|
||||
<Caret Line="1123" Column="10" TopLine="1121"/>
|
||||
</Position5>
|
||||
<Position6>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="688" Column="1" TopLine="683"/>
|
||||
<Caret Line="1130" Column="10" TopLine="1128"/>
|
||||
</Position6>
|
||||
<Position7>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="246" Column="1" TopLine="227"/>
|
||||
<Caret Line="473" Column="3" TopLine="460"/>
|
||||
</Position7>
|
||||
<Position8>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="248" Column="1" TopLine="227"/>
|
||||
<Caret Line="479" Column="6" TopLine="457"/>
|
||||
</Position8>
|
||||
<Position9>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="246" Column="1" TopLine="227"/>
|
||||
<Caret Line="795" Column="7" TopLine="763"/>
|
||||
</Position9>
|
||||
<Position10>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="95" Column="100" TopLine="89"/>
|
||||
<Caret Line="797" Column="7" TopLine="765"/>
|
||||
</Position10>
|
||||
<Position11>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="725" Column="35" TopLine="708"/>
|
||||
<Caret Line="799" Column="37" TopLine="767"/>
|
||||
</Position11>
|
||||
<Position12>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="286" Column="33" TopLine="270"/>
|
||||
<Caret Line="800" Column="40" TopLine="768"/>
|
||||
</Position12>
|
||||
<Position13>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="733" Column="68" TopLine="705"/>
|
||||
<Caret Line="4" Column="99" TopLine="1"/>
|
||||
</Position13>
|
||||
<Position14>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="1122" Column="10" TopLine="1120"/>
|
||||
<Caret Line="463" Column="51" TopLine="431"/>
|
||||
</Position14>
|
||||
<Position15>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="1123" Column="10" TopLine="1121"/>
|
||||
<Caret Line="479" Column="7" TopLine="447"/>
|
||||
</Position15>
|
||||
<Position16>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="1130" Column="10" TopLine="1128"/>
|
||||
<Caret Line="5" Column="101" TopLine="1"/>
|
||||
</Position16>
|
||||
<Position17>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="473" Column="3" TopLine="460"/>
|
||||
<Caret Line="497" Column="11" TopLine="476"/>
|
||||
</Position17>
|
||||
<Position18>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="479" Column="6" TopLine="457"/>
|
||||
<Caret Line="501" Column="6" TopLine="475"/>
|
||||
</Position18>
|
||||
<Position19>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="795" Column="7" TopLine="763"/>
|
||||
<Caret Line="500" Column="6" TopLine="474"/>
|
||||
</Position19>
|
||||
<Position20>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="797" Column="7" TopLine="765"/>
|
||||
<Caret Line="1007" Column="12" TopLine="988"/>
|
||||
</Position20>
|
||||
<Position21>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="799" Column="37" TopLine="767"/>
|
||||
<Filename Value="lazimageeditor.pas"/>
|
||||
<Caret Line="26" Column="11" TopLine="1"/>
|
||||
</Position21>
|
||||
<Position22>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="800" Column="40" TopLine="768"/>
|
||||
<Filename Value="lazimageeditor.pas"/>
|
||||
<Caret Line="11" Column="30" TopLine="1"/>
|
||||
</Position22>
|
||||
<Position23>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="4" Column="99" TopLine="1"/>
|
||||
<Filename Value="lazimageeditor.pas"/>
|
||||
<Caret Line="26" Column="6" TopLine="1"/>
|
||||
</Position23>
|
||||
<Position24>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="463" Column="51" TopLine="431"/>
|
||||
<Filename Value="lazimageeditor.pas"/>
|
||||
<Caret Line="11" Column="30" TopLine="1"/>
|
||||
</Position24>
|
||||
<Position25>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="479" Column="7" TopLine="447"/>
|
||||
<Caret Line="767" Column="1" TopLine="748"/>
|
||||
</Position25>
|
||||
<Position26>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="5" Column="101" TopLine="1"/>
|
||||
<Caret Line="772" Column="3" TopLine="769"/>
|
||||
</Position26>
|
||||
<Position27>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="497" Column="11" TopLine="476"/>
|
||||
<Caret Line="749" Column="1" TopLine="743"/>
|
||||
</Position27>
|
||||
<Position28>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="501" Column="6" TopLine="475"/>
|
||||
<Caret Line="774" Column="47" TopLine="754"/>
|
||||
</Position28>
|
||||
<Position29>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="500" Column="6" TopLine="474"/>
|
||||
<Caret Line="289" Column="1" TopLine="273"/>
|
||||
</Position29>
|
||||
<Position30>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="1007" Column="12" TopLine="988"/>
|
||||
<Caret Line="724" Column="1" TopLine="708"/>
|
||||
</Position30>
|
||||
</JumpHistory>
|
||||
</ProjectOptions>
|
||||
|
@ -8,7 +8,7 @@ uses
|
||||
{$ENDIF}{$ENDIF}
|
||||
Interfaces, // this includes the LCL widgetset Preview,
|
||||
Forms, Main, PictureManager, PictureCtrls, Test,
|
||||
NewDialog, ResizeDialog, ResizePaperDialog, PictureDialog, AboutDialog, LazColorPalette;
|
||||
NewDialog, ResizeDialog, ResizePaperDialog, PictureDialog, AboutDialog;
|
||||
|
||||
{$R *.res}
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
object MainForm: TMainForm
|
||||
Left = 260
|
||||
Left = 180
|
||||
Height = 666
|
||||
Top = 147
|
||||
Top = 135
|
||||
Width = 905
|
||||
Caption = 'Lazarus Image Editor'
|
||||
ClientHeight = 644
|
||||
@ -1292,9 +1292,9 @@
|
||||
TabOrder = 5
|
||||
object checkFuzzy: TCheckBox
|
||||
Left = 4
|
||||
Height = 19
|
||||
Height = 23
|
||||
Top = 9
|
||||
Width = 20
|
||||
Width = 24
|
||||
OnChange = checkFuzzyChange
|
||||
TabOrder = 0
|
||||
end
|
||||
|
@ -1,8 +1,8 @@
|
||||
{ This is an automatically generated lazarus resource file }
|
||||
|
||||
LazarusResources.Add('TMainForm','FORMDATA',[
|
||||
'TPF0'#9'TMainForm'#8'MainForm'#4'Left'#3#4#1#6'Height'#3#154#2#3'Top'#3#147#0
|
||||
+#5'Width'#3#137#3#7'Caption'#6#20'Lazarus Image Editor'#12'ClientHeight'#3
|
||||
'TPF0'#9'TMainForm'#8'MainForm'#4'Left'#3#180#0#6'Height'#3#154#2#3'Top'#3#135
|
||||
+#0#5'Width'#3#137#3#7'Caption'#6#20'Lazarus Image Editor'#12'ClientHeight'#3
|
||||
+#132#2#11'ClientWidth'#3#137#3#12'Font.CharSet'#7#14'GB2312_CHARSET'#11'Font'
|
||||
+'.Height'#2#243#9'Font.Name'#6#12#229#190#174#232#189#175#233#155#133#233#187
|
||||
+#145#10'Font.Pitch'#7#10'fpVariable'#12'Font.Quality'#7#7'fqDraft'#4'Menu'#7
|
||||
@ -733,7 +733,7 @@ LazarusResources.Add('TMainForm','FORMDATA',[
|
||||
+'rentColor'#8#0#0#6'TPanel'#15'PanelTolerance2'#4'Left'#3#134#2#6'Height'#2
|
||||
+'"'#3'Top'#2#0#5'Width'#2#30#5'Align'#7#6'alLeft'#10'BevelOuter'#7#6'bvNone'
|
||||
+#12'ClientHeight'#2'"'#11'ClientWidth'#2#30#8'TabOrder'#2#5#0#9'TCheckBox'#10
|
||||
+'checkFuzzy'#4'Left'#2#4#6'Height'#2#19#3'Top'#2#9#5'Width'#2#20#8'OnChange'
|
||||
+'checkFuzzy'#4'Left'#2#4#6'Height'#2#23#3'Top'#2#9#5'Width'#2#24#8'OnChange'
|
||||
+#7#16'checkFuzzyChange'#8'TabOrder'#2#0#0#0#0#0#0#6'TPanel'#13'PanelPictures'
|
||||
+#4'Left'#2'('#6'Height'#3#5#2#3'Top'#2'i'#5'Width'#3#22#3#5'Align'#7#8'alCli'
|
||||
+'ent'#10'BevelOuter'#7#9'bvLowered'#8'TabOrder'#2#3#0#0#9'TMainMenu'#8'MainM'
|
||||
|
@ -286,7 +286,6 @@ type
|
||||
procedure ViewShowPreviewExecute(Sender: TObject);
|
||||
private
|
||||
Pictures: TPictureManager;
|
||||
CurrentPaletteColor: TColor;
|
||||
function GetActivePicture: TPictureBitmap;
|
||||
function GetActivePictureEdit: TPictureEdit;
|
||||
function GetActivePicturePage: TPicturePage;
|
||||
@ -722,7 +721,6 @@ begin
|
||||
if ssMiddle in Shift then
|
||||
PaperColor := AColor;
|
||||
end;
|
||||
CurrentPaletteColor := AColor;
|
||||
end;
|
||||
|
||||
procedure TMainForm.PanelFillDblClick(Sender: TObject);
|
||||
@ -765,13 +763,13 @@ begin
|
||||
Exit;
|
||||
if Source is TColorPalette then
|
||||
begin
|
||||
// TPanel(Sender).Color:=CurrentPaletteColor;
|
||||
TPanel(Sender).Color:=Palette.PickedColor;
|
||||
if Sender = PanelPaper then
|
||||
ActivePictureEdit.PaperColor := CurrentPaletteColor;
|
||||
ActivePictureEdit.PaperColor := Palette.PickedColor;
|
||||
if Sender = PanelFill then
|
||||
ActivePictureEdit.FillColor := CurrentPaletteColor;
|
||||
ActivePictureEdit.FillColor := Palette.PickedColor;
|
||||
if Sender = PanelOutline then
|
||||
ActivePictureEdit.OutlineColor := CurrentPaletteColor;
|
||||
ActivePictureEdit.OutlineColor := Palette.PickedColor;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
Reference in New Issue
Block a user