You've already forked lazarus-ccr
the copy, paste, delete, save, open functions has be completed.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@1534 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -189,7 +189,7 @@ begin
|
||||
end;
|
||||
|
||||
constructor TRGB32Bitmap.CreateFromBitmap(ABitmap: TRasterImage);
|
||||
var
|
||||
{var
|
||||
Image: TLazIntfImage;
|
||||
begin
|
||||
Image := ABitmap.CreateIntfImage;
|
||||
@ -198,6 +198,10 @@ begin
|
||||
finally
|
||||
Image.Free;
|
||||
end;
|
||||
end; }
|
||||
begin
|
||||
Create(ABitmap.Width, ABitmap.Height);
|
||||
Canvas.Draw(0,0,ABitmap);
|
||||
end;
|
||||
|
||||
destructor TRGB32Bitmap.Destroy;
|
||||
|
@ -47,9 +47,9 @@
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="lazimageeditor"/>
|
||||
<WindowIndex Value="0"/>
|
||||
<TopLine Value="3"/>
|
||||
<CursorPos X="102" Y="16"/>
|
||||
<UsageCount Value="55"/>
|
||||
<TopLine Value="2"/>
|
||||
<CursorPos X="11" Y="26"/>
|
||||
<UsageCount Value="59"/>
|
||||
</Unit0>
|
||||
<Unit1>
|
||||
<Filename Value="main.pas"/>
|
||||
@ -58,23 +58,23 @@
|
||||
<HasResources Value="True"/>
|
||||
<ResourceBaseClass Value="Form"/>
|
||||
<UnitName Value="Main"/>
|
||||
<IsVisibleTab Value="True"/>
|
||||
<EditorIndex Value="0"/>
|
||||
<WindowIndex Value="0"/>
|
||||
<TopLine Value="1129"/>
|
||||
<CursorPos X="14" Y="1141"/>
|
||||
<UsageCount Value="55"/>
|
||||
<TopLine Value="1030"/>
|
||||
<CursorPos X="5" Y="1046"/>
|
||||
<UsageCount Value="59"/>
|
||||
<Loaded Value="True"/>
|
||||
<LoadedDesigner Value="True"/>
|
||||
</Unit1>
|
||||
<Unit2>
|
||||
<Filename Value="picturectrls.pas"/>
|
||||
<UnitName Value="PictureCtrls"/>
|
||||
<IsVisibleTab Value="True"/>
|
||||
<EditorIndex Value="3"/>
|
||||
<EditorIndex Value="2"/>
|
||||
<WindowIndex Value="0"/>
|
||||
<TopLine Value="1089"/>
|
||||
<CursorPos X="7" Y="1102"/>
|
||||
<UsageCount Value="24"/>
|
||||
<TopLine Value="1157"/>
|
||||
<CursorPos X="15" Y="1170"/>
|
||||
<UsageCount Value="26"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit2>
|
||||
<Unit3>
|
||||
@ -169,19 +169,21 @@
|
||||
<Unit12>
|
||||
<Filename Value="T:\fpclaz\laz\lcl\graphics.pp"/>
|
||||
<UnitName Value="Graphics"/>
|
||||
<EditorIndex Value="4"/>
|
||||
<WindowIndex Value="0"/>
|
||||
<TopLine Value="2116"/>
|
||||
<CursorPos X="27" Y="2142"/>
|
||||
<TopLine Value="1404"/>
|
||||
<CursorPos X="27" Y="1404"/>
|
||||
<UsageCount Value="10"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit12>
|
||||
<Unit13>
|
||||
<Filename Value="picturemanager.pas"/>
|
||||
<UnitName Value="PictureManager"/>
|
||||
<EditorIndex Value="2"/>
|
||||
<EditorIndex Value="1"/>
|
||||
<WindowIndex Value="0"/>
|
||||
<TopLine Value="304"/>
|
||||
<CursorPos X="36" Y="324"/>
|
||||
<UsageCount Value="25"/>
|
||||
<TopLine Value="233"/>
|
||||
<CursorPos X="40" Y="250"/>
|
||||
<UsageCount Value="27"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit13>
|
||||
<Unit14>
|
||||
@ -278,7 +280,7 @@
|
||||
<WindowIndex Value="0"/>
|
||||
<TopLine Value="34"/>
|
||||
<CursorPos X="72" Y="5"/>
|
||||
<UsageCount Value="20"/>
|
||||
<UsageCount Value="22"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit25>
|
||||
<Unit26>
|
||||
@ -302,19 +304,19 @@
|
||||
<UnitName Value="BmpRGBGraph"/>
|
||||
<EditorIndex Value="6"/>
|
||||
<WindowIndex Value="0"/>
|
||||
<TopLine Value="114"/>
|
||||
<CursorPos X="38" Y="385"/>
|
||||
<UsageCount Value="16"/>
|
||||
<TopLine Value="100"/>
|
||||
<CursorPos X="15" Y="122"/>
|
||||
<UsageCount Value="18"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit28>
|
||||
<Unit29>
|
||||
<Filename Value="rgbdrawutils.pas"/>
|
||||
<UnitName Value="RGBDrawUtils"/>
|
||||
<EditorIndex Value="4"/>
|
||||
<EditorIndex Value="3"/>
|
||||
<WindowIndex Value="0"/>
|
||||
<TopLine Value="494"/>
|
||||
<CursorPos X="11" Y="506"/>
|
||||
<UsageCount Value="15"/>
|
||||
<TopLine Value="1"/>
|
||||
<CursorPos X="36" Y="15"/>
|
||||
<UsageCount Value="17"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit29>
|
||||
<Unit30>
|
||||
@ -331,13 +333,10 @@
|
||||
<HasResources Value="True"/>
|
||||
<ResourceBaseClass Value="Form"/>
|
||||
<UnitName Value="PictureDialog"/>
|
||||
<EditorIndex Value="1"/>
|
||||
<WindowIndex Value="0"/>
|
||||
<TopLine Value="71"/>
|
||||
<CursorPos X="43" Y="86"/>
|
||||
<UsageCount Value="11"/>
|
||||
<Loaded Value="True"/>
|
||||
<LoadedDesigner Value="True"/>
|
||||
<UsageCount Value="13"/>
|
||||
</Unit31>
|
||||
<Unit32>
|
||||
<Filename Value="T:\fpclaz\laz\lcl\forms.pp"/>
|
||||
@ -350,124 +349,124 @@
|
||||
</Units>
|
||||
<JumpHistory Count="30" HistoryIndex="29">
|
||||
<Position1>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="653" Column="26" TopLine="632"/>
|
||||
<Filename Value="picturemanager.pas"/>
|
||||
<Caret Line="108" Column="65" TopLine="82"/>
|
||||
</Position1>
|
||||
<Position2>
|
||||
<Filename Value="rgbdrawutils.pas"/>
|
||||
<Caret Line="507" Column="10" TopLine="488"/>
|
||||
<Filename Value="picturemanager.pas"/>
|
||||
<Caret Line="191" Column="31" TopLine="177"/>
|
||||
</Position2>
|
||||
<Position3>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="1198" Column="97" TopLine="1191"/>
|
||||
<Filename Value="picturemanager.pas"/>
|
||||
<Caret Line="193" Column="38" TopLine="177"/>
|
||||
</Position3>
|
||||
<Position4>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="14" Column="94" TopLine="10"/>
|
||||
<Filename Value="picturemanager.pas"/>
|
||||
<Caret Line="277" Column="31" TopLine="263"/>
|
||||
</Position4>
|
||||
<Position5>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="35" Column="34" TopLine="14"/>
|
||||
<Filename Value="picturemanager.pas"/>
|
||||
<Caret Line="279" Column="58" TopLine="263"/>
|
||||
</Position5>
|
||||
<Position6>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="72" Column="18" TopLine="51"/>
|
||||
<Filename Value="picturemanager.pas"/>
|
||||
<Caret Line="282" Column="31" TopLine="263"/>
|
||||
</Position6>
|
||||
<Position7>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="73" Column="18" TopLine="52"/>
|
||||
<Filename Value="picturemanager.pas"/>
|
||||
<Caret Line="287" Column="9" TopLine="263"/>
|
||||
</Position7>
|
||||
<Position8>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="120" Column="19" TopLine="99"/>
|
||||
<Filename Value="picturemanager.pas"/>
|
||||
<Caret Line="391" Column="46" TopLine="371"/>
|
||||
</Position8>
|
||||
<Position9>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="121" Column="19" TopLine="100"/>
|
||||
<Filename Value="picturectrls.pas"/>
|
||||
<Caret Line="163" Column="26" TopLine="147"/>
|
||||
</Position9>
|
||||
<Position10>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="241" Column="29" TopLine="220"/>
|
||||
<Caret Line="1044" Column="14" TopLine="1032"/>
|
||||
</Position10>
|
||||
<Position11>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="242" Column="29" TopLine="221"/>
|
||||
<Filename Value="picturemanager.pas"/>
|
||||
<Caret Line="88" Column="19" TopLine="72"/>
|
||||
</Position11>
|
||||
<Position12>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="278" Column="26" TopLine="257"/>
|
||||
<Filename Value="picturectrls.pas"/>
|
||||
<Caret Line="521" Column="33" TopLine="506"/>
|
||||
</Position12>
|
||||
<Position13>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="333" Column="35" TopLine="312"/>
|
||||
<Caret Line="1044" Column="14" TopLine="1032"/>
|
||||
</Position13>
|
||||
<Position14>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="337" Column="9" TopLine="316"/>
|
||||
<Caret Line="1038" Column="14" TopLine="1030"/>
|
||||
</Position14>
|
||||
<Position15>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="340" Column="35" TopLine="319"/>
|
||||
<Caret Line="295" Column="28" TopLine="279"/>
|
||||
</Position15>
|
||||
<Position16>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="344" Column="9" TopLine="323"/>
|
||||
<Caret Line="1038" Column="20" TopLine="1012"/>
|
||||
</Position16>
|
||||
<Position17>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="396" Column="5" TopLine="372"/>
|
||||
<Caret Line="1046" Column="1" TopLine="1016"/>
|
||||
</Position17>
|
||||
<Position18>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="629" Column="32" TopLine="608"/>
|
||||
<Caret Line="1229" Column="1" TopLine="1198"/>
|
||||
</Position18>
|
||||
<Position19>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="771" Column="16" TopLine="750"/>
|
||||
<Caret Line="1" Column="1" TopLine="1"/>
|
||||
</Position19>
|
||||
<Position20>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="772" Column="16" TopLine="751"/>
|
||||
<Caret Line="295" Column="28" TopLine="269"/>
|
||||
</Position20>
|
||||
<Position21>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="861" Column="47" TopLine="840"/>
|
||||
<Caret Line="1038" Column="20" TopLine="1012"/>
|
||||
</Position21>
|
||||
<Position22>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="897" Column="49" TopLine="876"/>
|
||||
<Caret Line="1046" Column="27" TopLine="1016"/>
|
||||
</Position22>
|
||||
<Position23>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="898" Column="44" TopLine="877"/>
|
||||
<Caret Line="1044" Column="11" TopLine="1028"/>
|
||||
</Position23>
|
||||
<Position24>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="927" Column="50" TopLine="906"/>
|
||||
<Caret Line="23" Column="77" TopLine="20"/>
|
||||
</Position24>
|
||||
<Position25>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="928" Column="45" TopLine="846"/>
|
||||
<Caret Line="295" Column="28" TopLine="269"/>
|
||||
</Position25>
|
||||
<Position26>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="1141" Column="14" TopLine="1129"/>
|
||||
<Caret Line="1038" Column="20" TopLine="1024"/>
|
||||
</Position26>
|
||||
<Position27>
|
||||
<Filename Value="picturemanager.pas"/>
|
||||
<Caret Line="89" Column="65" TopLine="78"/>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="1046" Column="23" TopLine="1024"/>
|
||||
</Position27>
|
||||
<Position28>
|
||||
<Filename Value="picturemanager.pas"/>
|
||||
<Caret Line="94" Column="20" TopLine="78"/>
|
||||
<Filename Value="main.pas"/>
|
||||
<Caret Line="1044" Column="24" TopLine="1030"/>
|
||||
</Position28>
|
||||
<Position29>
|
||||
<Filename Value="picturemanager.pas"/>
|
||||
<Caret Line="324" Column="36" TopLine="304"/>
|
||||
<Filename Value="picturectrls.pas"/>
|
||||
<Caret Line="198" Column="22" TopLine="182"/>
|
||||
</Position29>
|
||||
<Position30>
|
||||
<Filename Value="picturectrls.pas"/>
|
||||
<Caret Line="191" Column="20" TopLine="175"/>
|
||||
<Caret Line="1170" Column="15" TopLine="1157"/>
|
||||
</Position30>
|
||||
</JumpHistory>
|
||||
</ProjectOptions>
|
||||
|
@ -23,7 +23,10 @@ begin
|
||||
// show new picture dialog
|
||||
MainForm.Show;
|
||||
//MainForm.FileNewExecute(nil);
|
||||
MainForm.FileNewOnStart;
|
||||
if ParamCount > 0 then
|
||||
MainForm.OpenImageFile(ParamStr(1))
|
||||
else
|
||||
MainForm.FileNewOnStart;
|
||||
|
||||
Application.Run;
|
||||
end.
|
||||
|
@ -1281,9 +1281,9 @@
|
||||
TabOrder = 5
|
||||
object checkFuzzy: TCheckBox
|
||||
Left = 4
|
||||
Height = 23
|
||||
Height = 19
|
||||
Top = 9
|
||||
Width = 24
|
||||
Width = 20
|
||||
OnChange = checkFuzzyChange
|
||||
TabOrder = 0
|
||||
end
|
||||
|
@ -728,8 +728,8 @@ LazarusResources.Add('TMainForm','FORMDATA',[
|
||||
+'ht'#2' '#6'Layout'#7#8'tlCenter'#11'ParentColor'#8#0#0#6'TPanel'#15'PanelTo'
|
||||
+'lerance2'#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#23
|
||||
+#3'Top'#2#9#5'Width'#2#24#8'OnChange'#7#16'checkFuzzyChange'#8'TabOrder'#2#0
|
||||
+#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'#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'alClient'#10'BevelOuter'#7#9'bvLowered'#8'T'
|
||||
+'abOrder'#2#3#0#0#9'TMainMenu'#8'MainMenu'#6'Images'#7#16'ImageListActions'#4
|
||||
|
@ -292,6 +292,7 @@ type
|
||||
procedure UpdateAll;
|
||||
public
|
||||
procedure FileNewOnStart;
|
||||
procedure OpenImageFile(FileName: string);
|
||||
property ActivePicture: TPictureBitmap read GetActivePicture;
|
||||
property ActivePicturePage: TPicturePage read GetActivePicturePage;
|
||||
property ActivePictureEdit: TPictureEdit read GetActivePictureEdit;
|
||||
@ -1023,7 +1024,7 @@ end;
|
||||
|
||||
procedure TMainForm.FileNewOnStart;
|
||||
begin
|
||||
Pictures.New(640, 480, clTeal);
|
||||
Pictures.New(520, 390, $F1EFDA);
|
||||
end;
|
||||
|
||||
procedure TMainForm.FileOpenExecute(Sender: TObject);
|
||||
@ -1033,10 +1034,16 @@ begin
|
||||
if OpenPictureDialog.Execute then
|
||||
begin
|
||||
for I := 0 to Pred(OpenPictureDialog.Files.Count) do
|
||||
Pictures.Load(OpenPictureDialog.Files[I]);
|
||||
//Pictures.Load(OpenPictureDialog.Files[I]);
|
||||
OpenImageFile(OpenPictureDialog.Files[I]);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TMainForm.OpenImageFile(FileName: string);
|
||||
begin
|
||||
Pictures.Load(FileName);
|
||||
end;
|
||||
|
||||
procedure TMainForm.FileSaveAsExecute(Sender: TObject);
|
||||
begin
|
||||
if SavePictureDialog.Execute then
|
||||
@ -1153,9 +1160,9 @@ begin
|
||||
if not Pictures.CanEdit then
|
||||
Exit;
|
||||
ActivePictureEdit.SelectAll;
|
||||
MenuItemCopy.Enabled:=True;
|
||||
MenuItemPaste.Enabled:=True;
|
||||
MenuItemDelete.Enabled:=True;
|
||||
MenuItemCopy.Enabled := True;
|
||||
MenuItemPaste.Enabled := True;
|
||||
MenuItemDelete.Enabled := True;
|
||||
MenuItemCopy.OnClick := @EditCopyExecute;
|
||||
MenuItemPaste.OnClick := @EditPasteExecute;
|
||||
MenuItemDelete.OnClick := @EditDeleteExecute;
|
||||
|
@ -521,8 +521,15 @@ begin
|
||||
end;
|
||||
|
||||
procedure TCustomPictureView.SavePicture(const FileName: String);
|
||||
var Pic: TPicture;
|
||||
begin
|
||||
Picture.SaveToFile(FileName);
|
||||
Pic := TPicture.Create;
|
||||
//Picture.SaveToFile(UTF8Decode(FileName));
|
||||
Pic.Bitmap.Width := Picture.Width;
|
||||
Pic.Bitmap.Height := Picture.Height;
|
||||
Pic.Bitmap.Canvas.Draw(0,0,Picture);
|
||||
Pic.SaveToFile(FileName);
|
||||
Pic.Free;
|
||||
end;
|
||||
|
||||
procedure TCustomPictureView.ExportPictureAsLazarusResource(const AFileName,
|
||||
|
@ -31,7 +31,7 @@ interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, LResources, Controls, Graphics, ExtCtrls, ComCtrls,
|
||||
Forms, PictureCtrls;
|
||||
Forms, PictureCtrls, RGBDrawUtils;
|
||||
|
||||
type
|
||||
|
||||
@ -235,20 +235,25 @@ end;
|
||||
procedure TPictureManager.Load(const FileName: String);
|
||||
var
|
||||
NewPage: TPicturePage;
|
||||
Icon: TIcon;
|
||||
Icon: TCustomRGBBitmapCore;
|
||||
I: Integer;
|
||||
Pic: TPicture;
|
||||
begin
|
||||
if SameText(ExtractFileExt(FileName), '.ico') then
|
||||
begin
|
||||
Icon := TIcon.Create;
|
||||
//if SameText(ExtractFileExt(FileName), '.ico') then
|
||||
//begin
|
||||
Icon := TCustomRGBBitmapCore.Create;
|
||||
try
|
||||
// First image in std bitmap
|
||||
Icon.LoadFromFile(FileName);
|
||||
|
||||
// Icon.LoadFromFile(FileName);
|
||||
Pic := TPicture.Create;
|
||||
Pic.LoadFromFile(FileName);
|
||||
Icon.Width:=Pic.Width;
|
||||
Icon.Height:=Pic.Height;
|
||||
Icon.Canvas.Draw(0,0,Pic.Graphic);
|
||||
// other images
|
||||
for I := 0 to Pred(Icon.Count) do
|
||||
//for I := 0 to Pred(Icon.Count) do
|
||||
begin
|
||||
Icon.Current := I;
|
||||
// Icon.Current := I;
|
||||
NewPage := CreatePage(Icon);
|
||||
NewPage.Parent := Self;
|
||||
ActivePage := NewPage;
|
||||
@ -257,15 +262,16 @@ begin
|
||||
end;
|
||||
finally
|
||||
Icon.Free;
|
||||
Pic.Free;
|
||||
end;
|
||||
end
|
||||
{end
|
||||
else
|
||||
begin
|
||||
NewPage := CreatePage(FileName);
|
||||
NewPage.Parent := Self;
|
||||
ActivePage := NewPage;
|
||||
Change;
|
||||
end;
|
||||
end; }
|
||||
end;
|
||||
|
||||
procedure TPictureManager.Save;
|
||||
|
Reference in New Issue
Block a user