Changeset 26
- Timestamp:
- Dec 22, 2016, 5:07:02 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 15 added
- 3 deleted
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormMain.lfm
r13 r26 5 5 Width = 920 6 6 Caption = 'LibrePaint' 7 ClientHeight = 61 47 ClientHeight = 615 8 8 ClientWidth = 920 9 9 Menu = MainMenu1 … … 12 12 OnDestroy = FormDestroy 13 13 OnShow = FormShow 14 LCLVersion = '1. 3'14 LCLVersion = '1.6.2.0' 15 15 object PaintBox1: TPaintBox 16 16 Left = 0 17 Height = 58 817 Height = 587 18 18 Top = 0 19 19 Width = 920 20 20 Align = alClient 21 21 OnMouseDown = PaintBox1MouseDown 22 OnMouseLeave = PaintBox1MouseLeave 22 23 OnMouseMove = PaintBox1MouseMove 23 24 OnMouseUp = PaintBox1MouseUp 24 OnMouseLeave = PaintBox1MouseLeave25 25 OnMouseWheelDown = PaintBox1MouseWheelDown 26 26 OnMouseWheelUp = PaintBox1MouseWheelUp … … 30 30 object StatusBar1: TStatusBar 31 31 Left = 0 32 Height = 2 633 Top = 58 832 Height = 28 33 Top = 587 34 34 Width = 920 35 35 Panels = < -
trunk/Forms/UFormNew.lfm
r2 r26 8 8 ClientWidth = 497 9 9 OnShow = FormShow 10 LCLVersion = '1. 3'10 LCLVersion = '1.6.2.0' 11 11 object SpinEditWidth: TSpinEdit 12 12 Left = 168 13 Height = 3513 Height = 28 14 14 Top = 24 15 15 Width = 122 … … 20 20 object Label1: TLabel 21 21 Left = 15 22 Height = 2 522 Height = 20 23 23 Top = 26 24 Width = 6024 Width = 43 25 25 Caption = 'Width:' 26 26 ParentColor = False … … 28 28 object Label2: TLabel 29 29 Left = 15 30 Height = 2 530 Height = 20 31 31 Top = 64 32 Width = 6732 Width = 48 33 33 Caption = 'Height:' 34 34 ParentColor = False … … 36 36 object SpinEditHeight: TSpinEdit 37 37 Left = 168 38 Height = 3538 Height = 28 39 39 Top = 64 40 40 Width = 122 … … 45 45 object Label3: TLabel 46 46 Left = 15 47 Height = 2 547 Height = 20 48 48 Top = 104 49 Width = 10349 Width = 73 50 50 Caption = 'Resolution:' 51 51 ParentColor = False … … 53 53 object SpinEditDPI: TSpinEdit 54 54 Left = 168 55 Height = 3555 Height = 28 56 56 Top = 104 57 57 Width = 122 … … 62 62 object Label4: TLabel 63 63 Left = 15 64 Height = 2 564 Height = 20 65 65 Top = 167 66 Width = 11566 Width = 82 67 67 Caption = 'Color depth:' 68 68 ParentColor = False … … 70 70 object ComboBoxColorFormat: TComboBox 71 71 Left = 167 72 Height = 3572 Height = 28 73 73 Top = 157 74 74 Width = 209 75 ItemHeight = 075 ItemHeight = 20 76 76 OnChange = SpinEditWidthChange 77 77 Style = csDropDownList … … 99 99 object Label5: TLabel 100 100 Left = 16 101 Height = 2 5101 Height = 20 102 102 Top = 224 103 Width = 1 68103 Width = 118 104 104 Caption = 'Memory required:' 105 105 ParentColor = False … … 107 107 object LabelMemRequire: TLabel 108 108 Left = 192 109 Height = 2 5109 Height = 20 110 110 Top = 224 111 Width = 1 5111 Width = 12 112 112 Caption = ' ' 113 113 ParentColor = False -
trunk/Forms/UFormNew.pas
r14 r26 7 7 uses 8 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, Spin, 9 StdCtrls, ActnList, U Graphic;9 StdCtrls, ActnList, UFGraphics; 10 10 11 11 type … … 45 45 procedure TFormNew.SpinEditWidthChange(Sender: TObject); 46 46 var 47 ColorFormat: T GColorFormat;47 ColorFormat: TColorFormat; 48 48 begin 49 ColorFormat := Color Manager.Formats[ComboBoxColorFormat.ItemIndex];49 ColorFormat := ColorFormatManager.Formats[ComboBoxColorFormat.ItemIndex]; 50 50 LabelMemRequire.Caption := IntToStr(SpinEditWidth.Value * SpinEditHeight.Value * 51 51 ColorFormat.BitDepth div 8) + ' bytes'; … … 54 54 procedure TFormNew.FormShow(Sender: TObject); 55 55 var 56 ColorFormat: T GColorFormat;56 ColorFormat: TColorFormat; 57 57 I: Integer; 58 58 begin 59 59 ComboBoxColorFormat.Clear; 60 for I := 0 to Color Manager.FormatCount - 1 do begin61 ColorFormat := Color Manager.Formats[I];60 for I := 0 to ColorFormatManager.FormatCount - 1 do begin 61 ColorFormat := ColorFormatManager.Formats[I]; 62 62 ComboBoxColorFormat.AddItem(ColorFormat.Name, nil); 63 63 end; -
trunk/LibrePaint.lpi
r16 r26 27 27 <SearchPaths> 28 28 <IncludeFiles Value="$(ProjOutDir)"/> 29 <OtherUnitFiles Value="Forms ;ColorFormats"/>29 <OtherUnitFiles Value="Forms"/> 30 30 <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/> 31 31 </SearchPaths> … … 66 66 </local> 67 67 </RunParams> 68 <RequiredPackages Count=" 1">68 <RequiredPackages Count="2"> 69 69 <Item1> 70 <PackageName Value="FastGraphics"/> 71 <DefaultFilename Value="Packages/FastGraphics/FastGraphics.lpk" Prefer="True"/> 72 </Item1> 73 <Item2> 70 74 <PackageName Value="LCL"/> 71 </Item 1>75 </Item2> 72 76 </RequiredPackages> 73 <Units Count=" 12">77 <Units Count="5"> 74 78 <Unit0> 75 79 <Filename Value="LibrePaint.lpr"/> … … 82 86 <HasResources Value="True"/> 83 87 <ResourceBaseClass Value="DataModule"/> 84 <UnitName Value="UCore"/>85 88 </Unit1> 86 89 <Unit2> 87 <Filename Value="U Graphic.pas"/>90 <Filename Value="UProject.pas"/> 88 91 <IsPartOfProject Value="True"/> 89 <UnitName Value="UGraphic"/>90 92 </Unit2> 91 93 <Unit3> 92 <Filename Value="UProject.pas"/>93 <IsPartOfProject Value="True"/>94 </Unit3>95 <Unit4>96 94 <Filename Value="Forms/UFormNew.pas"/> 97 95 <IsPartOfProject Value="True"/> … … 99 97 <HasResources Value="True"/> 100 98 <ResourceBaseClass Value="Form"/> 101 <UnitName Value="UFormNew"/> 102 </Unit4> 103 <Unit5> 104 <Filename Value="ColorFormats/UColorRGBA8.pas"/> 105 <IsPartOfProject Value="True"/> 106 <UnitName Value="UColorRGBA8"/> 107 </Unit5> 108 <Unit6> 99 </Unit3> 100 <Unit4> 109 101 <Filename Value="Forms/UFormMain.pas"/> 110 102 <IsPartOfProject Value="True"/> … … 112 104 <HasResources Value="True"/> 113 105 <ResourceBaseClass Value="Form"/> 114 <UnitName Value="UFormMain"/> 115 </Unit6> 116 <Unit7> 117 <Filename Value="ColorFormats/UColorGray8.pas"/> 118 <IsPartOfProject Value="True"/> 119 <UnitName Value="UColorGray8"/> 120 </Unit7> 121 <Unit8> 122 <Filename Value="ColorFormats/UColorGray1.pas"/> 123 <IsPartOfProject Value="True"/> 124 <UnitName Value="UColorGray1"/> 125 </Unit8> 126 <Unit9> 127 <Filename Value="UMemory.pas"/> 128 <IsPartOfProject Value="True"/> 129 </Unit9> 130 <Unit10> 131 <Filename Value="ColorFormats/UColorGray4.pas"/> 132 <IsPartOfProject Value="True"/> 133 </Unit10> 134 <Unit11> 135 <Filename Value="ColorFormats/UColorRGB565.pas"/> 136 <IsPartOfProject Value="True"/> 137 </Unit11> 106 </Unit4> 138 107 </Units> 139 108 </ProjectOptions> … … 145 114 <SearchPaths> 146 115 <IncludeFiles Value="$(ProjOutDir)"/> 147 <OtherUnitFiles Value="Forms ;ColorFormats"/>116 <OtherUnitFiles Value="Forms"/> 148 117 <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/> 149 118 </SearchPaths> … … 176 145 </Linking> 177 146 <Other> 147 <CompilerMessages> 148 <IgnoredMessages idx5024="True"/> 149 </CompilerMessages> 178 150 <CustomOptions Value="-dDEBUG"/> 179 151 </Other> -
trunk/LibrePaint.lpr
r15 r26 8 8 {$ENDIF}{$ENDIF} 9 9 Interfaces, // this includes the LCL widgetset 10 SysUtils, Forms, UCore, UGraphic, UProject, UMemory, UFormNew, UFormMain, 11 UColorRGBA8, UColorGray8, UColorGray1, UColorGray4, UColorRGB565 12 { you can add units after this }; 10 SysUtils, Forms, UCore, UProject, UFormNew, UFormMain; 13 11 14 12 {$R *.res} -
trunk/UCore.pas
r15 r26 6 6 7 7 uses 8 Classes, SysUtils, FileUtil, ActnList, UProject, U Graphic, Controls, Graphics,8 Classes, SysUtils, FileUtil, ActnList, UProject, UFGraphics, Controls, Graphics, 9 9 ExtDlgs, ExtCtrls; 10 10 … … 87 87 begin 88 88 Project := TProject.Create; 89 90 ColorManager.RegisterFormat(TGColorFormatRGBA8);91 ColorManager.RegisterFormat(TGColorFormatRGB565);92 ColorManager.RegisterFormat(TGColorFormatGray8);93 ColorManager.RegisterFormat(TGColorFormatGray4);94 ColorManager.RegisterFormat(TGColorFormatGray1);95 89 end; 96 90 … … 103 97 begin 104 98 // Set default 105 Project.Bitmap.ColorFormat := Color Manager.Formats[0];99 Project.Bitmap.ColorFormat := ColorFormatManager.Formats[0]; 106 100 Project.Bitmap.Size := Point(200, 100); 107 if ColorManager.FormatCount > 0 then108 Project.Bitmap.ColorFormat := ColorManager.Formats[0];109 101 Project.View.DestRect := Bounds(0, 0, FormMain.PaintBox1.Width, FormMain.PaintBox1.Height); 110 102 Core.AZoomAll.Execute; … … 114 106 begin 115 107 if FormNew.ShowModal = mrOk then begin 116 Project.Bitmap.ColorFormat := T GColorFormat.Create;108 Project.Bitmap.ColorFormat := TColorFormat.Create; 117 109 118 110 Project.FileName := 'New image'; 119 111 Project.Bitmap.Size := Point(FormNew.SpinEditWidth.Value, FormNew.SpinEditHeight.Value); 120 Project.Bitmap.ColorFormat := Color Manager.Formats[FormNew.ComboBoxColorFormat.ItemIndex];121 Project.Bitmap.BackgroundColor.FromTColor(clBlack);122 Project.Bitmap.DPI := FormNew.SpinEditDPI.Value;112 Project.Bitmap.ColorFormat := ColorFormatManager.Formats[FormNew.ComboBoxColorFormat.ItemIndex]; 113 // Project.Bitmap.BackgroundColor.FromTColor(clBlack); 114 // Project.Bitmap.DPI := FormNew.SpinEditDPI.Value; 123 115 AZoomAll.Execute; 124 116 end; … … 177 169 Image.Picture.LoadFromFile(OpenPictureDialog1.FileName); 178 170 Image.Picture.Bitmap.BeginUpdate(True); 179 Project.Bitmap. LoadFromCanvas(Image.Picture.Bitmap.Canvas,180 Point(Image.Picture.Bitmap.Width, Image.Picture.Bitmap.Height));171 Project.Bitmap.Size := Point(Image.Picture.Bitmap.Width, Image.Picture.Bitmap.Height); 172 Project.Bitmap.LoadFromCanvas(Image.Picture.Bitmap.Canvas); 181 173 Image.Picture.Bitmap.EndUpdate; 182 174 Image.Free; 175 AZoomAll.Execute; 183 176 FormMain.Redraw; 184 177 Project.FileName := OpenPictureDialog1.FileName; … … 214 207 begin 215 208 Project.Bitmap.Clear; 216 Project.Bitmap.Canvas.Pen.Color.Format := Project.Bitmap.ColorFormat;217 Project.Bitmap.Canvas.Pen.Color.FromTColor(clWhite);209 TFColor(Project.Bitmap.Canvas.Pen.Color).ColorFormat := Project.Bitmap.ColorFormat; 210 TFColor(Project.Bitmap.Canvas.Pen.Color).SetColorName(cnWhite); 218 211 Project.Bitmap.Canvas.Pen.MoveTo(Point(80, 80)); 219 212 Project.Bitmap.Canvas.Pen.LineTo(Point(50, 20)); -
trunk/UProject.pas
r13 r26 6 6 7 7 uses 8 Classes, SysUtils, U Graphic;8 Classes, SysUtils, UFGraphics; 9 9 10 10 type … … 34 34 TProject = class 35 35 FileName: string; 36 Bitmap: T GBitmap;36 Bitmap: TFPixmap; 37 37 View: TView; 38 38 Saved: Boolean; … … 119 119 constructor TProject.Create; 120 120 begin 121 Bitmap := T GBitmap.Create;121 Bitmap := TFPixmap.Create(nil); 122 122 View := TView.Create; 123 123 end;
Note:
See TracChangeset
for help on using the changeset viewer.